Filling out a form from a drop-down list

windows

Guest
I have a code that works with text-links, but I would like it to work from a drop-down list. Here's the links code:<br />
<br />
<br />
<html><br />
<body><br />
<br />
<div align="center"><br />
<table border="2" width="280" cellspacing="5" cellpadding="15" bordercolor="#000000"><br />
<tr><br />
<td width="239" bgcolor="#00FF00"><br />
<form name="resize"><br />
<input name="xval" size="5" value="640" class="forms">&nbsp; Window Width<br><br />
<input name="yval" size="5" value="480" class="forms">&nbsp; Window Height<br />
</form><br />
<br />
<p align="center"><br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="document.resize.xval.value='640',document.resize.yval.value='480'">640x480</a>,<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="document.resize.xval.value='800',document.resize.yval.value='600'">800x600</a>,<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="document.resize.xval.value='1024',document.resize.yval.value='768'">1024x768</a>,<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="document.resize.xval.value='1280',document.resize.yval.value='1024'">1280x1024</a>,<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="document.resize.xval.value='1400',document.resize.yval.value='1050'">1400x1050</a>,<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onclick="document.resize.xval.value='1600',document.resize.yval.value='1200'">1600x1200</a><br />
</p><br />
<br />
</td></tr><br />
</table><br />
</div><br />
<br />
</body><br />
</html><br />
<br />
<br />
I tried this, but it doesn't do the job:<br />
<br />
<br />
<p align="center"><br />
<select class="select"><br />
<option>Odd resolutions</option><br />
<option onselect="document.resize.xval.value='160',document.resize.yval.value='160'">160x160 : PalmOS</option><br />
<option onselect="document.resize.xval.value='176',document.resize.yval.value='160'">176x160 : Cell phone</option><br />
<option onselect="document.resize.xval.value='320',document.resize.yval.value='240'">320x240 : PocketPC</option><br />
<option onselect="document.resize.xval.value='320',document.resize.yval.value='320'">320x320 : PalmOS Hi</option><br />
<option onselect="document.resize.xval.value='640',document.resize.yval.value='240'">640x240 : WinCE</option><br />
<option onselect="document.resize.xval.value='544',document.resize.yval.value='372'">544x372 : WebTV</option><br />
</select><br />
</p><br />
<br />
<br />
Has anyone got any suggestions?<br />
<br />
Cheers, Jochem :cool:<!--content-->Try this:<br />
<html><br />
<head><br />
<title>Test</title><br />
<script language="JavaScript"><br />
function chgval(objval)<br />
{<br />
splitval=objval.split(",")<br />
document.resize.xval.value=splitval[0]<br />
document.resize.yval.value=splitval[1]<br />
}<br />
</script><br />
</head><br />
<body><br />
<br />
<div align="center"><br />
<table border="2" width="280" cellspacing="5" cellpadding="15" bordercolor="#000000"><br />
<tr><br />
<td width="239" bgcolor="#00FF00"><br />
<form name="resize"><br />
<input type="text" name="xval" size="5" value="640" class="forms"> Window Width<br><br />
<input type="text" name="yval" size="5" value="480" class="forms"> Window Height<br />
</form><br />
<select name="sel1" onChange="chgval(this.options[this.selectedIndex].value)"><br />
<option value="640,480">640x480</option><br />
<option value="800,600">800x600</option> <br />
</select><br />
</td></tr><br />
</table><br />
</div><br />
<br />
</body><br />
</html><!--content-->Cool! It works. Thanks for your help!<br />
<br />
Case closed... :D<!--content-->
 
Back
Top