Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamically changing a param value

Status
Not open for further replies.

emms

Programmer
Jan 11, 2001
55
0
0
GB
not sure if this is possible but I need to write a script to dynamically change the value of an applets parameter.

so far I've got a load of script with, I'm sure, many errors in. but hopefully it'll give you a clue as to what I'm trying to achieve. I'm also not sure if this will work as the applet may not change when the param is changed (if you see what I mean...)

<script language=&quot;Javascript&quot;>
function changeimage(filename) {
window.document.imageviewer.Image.value = filename;
}
</script>

<select name=&quot;changeim&quot; onchange=&quot;changeimage(this.value);&quot;>
<option>outside1.jpg</option>
<option>comms10.jpg</option>
</select>

<applet name=&quot;BeHereViewer&quot; code=&quot;BeHereViewer&quot; archive=&quot;imageviewer.jar&quot; width=&quot;528&quot; height=&quot;528&quot; align=&quot;center&quot;>
<param name=&quot;Image&quot; value=&quot;outside1.jpg&quot;>
<param name=&quot;autoSpin&quot; value=&quot;40&quot;>
</applet>

-- oh dear more confused now than I was when I started to write this!

thanks for any help

Emma
 
um guys? any help'd be good - even if its just 'give up its impossible'!

thanks
 
I don't think it is possible to change it once the page loaded but I think it would be possible to do it using document.write() when the page loads. After that though your guess is as good as mine. Gary Haran
 
you can but you would have to replace the entire applet code

<div id=AppletHolder>
<applet name=&quot;BeHereViewer&quot; code=&quot;BeHereViewer&quot; archive=&quot;imageviewer.jar&quot; width=&quot;528&quot; height=&quot;528&quot; align=&quot;center&quot;>
<param name=&quot;Image&quot; value=&quot;outside1.jpg&quot;>
<param name=&quot;autoSpin&quot; value=&quot;40&quot;>
</applet>
</div>
<a href=&quot;#&quot; onclick=&quot;changeAppletParams(1); return false&quot;>change 1</a>&nbsp;
<a href=&quot;#&quot; onclick=&quot;changeAppletParams(2); return false&quot;>change 2</a>


<script language=javascript>
function changeAppletParams(paramVal)
{
var paramset1 = &quot;<applet name=\&quot;BeHereViewer\&quot; code=\&quot;BeHereViewer\&quot; archive=\&quot;imageviewer.jar\&quot; width=\&quot;528\&quot; height=\&quot;528\&quot; align=\&quot;center\&quot;><param name=\&quot;Image\&quot; value=\&quot;inside1.jpg\&quot;><param name=\&quot;autoSpin\&quot; value=\&quot;70\&quot;></applet>&quot;


var paramset2 = &quot;<applet name=\&quot;BeHereViewer\&quot; code=\&quot;BeHereViewer\&quot; archive=\&quot;imageviewer.jar\&quot; width=\&quot;528\&quot; height=\&quot;528\&quot; align=\&quot;center\&quot;><param name=\&quot;Image\&quot; value=\&quot;outside2.jpg\&quot;><param name=\&quot;autoSpin\&quot; value=\&quot;30\&quot;></applet>&quot;

if (paramVal==1) {AppletHolder.innerHTML=paramset1}
else {AppletHolder.innerHTML=paramset2}

}
</script>
 
thats brilliant guys, thankyou!

I'll check it all out on monday.

Em
 
You're best bet is using a PHP script I think and then include() the variable back into the html after the input has been parsed by the user via a $param variable for example.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top