PDA

View Full Version : List Values - onChange=submit / Help



dantown
02-21-2012, 11:10 AM
How to add function to get onchange submit.

below the functions and the form in my page:
:
function openRoom(iRoomID, sRoomName)
{
document.getElementById('roomname').innerText = sRoomName;
document.mychat.ReconnectClient(iRoomID);
}
function MM_jumpMenuGo(objId,targ,restore){ //v9.0
var selObj = null; with (document) {
if (getElementById) selObj = getElementById(objId);
if (selObj) eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0; }
}
and for the list value form this code:
<form name="form" id="form">
<select name="jumpMenu" id="jumpMenu">
<option value="JavaScript:mychat.ReconnectClient(100);">Room1</option>
<option value="JavaScript:mychat.ReconnectClient(101);">Room2</option>
</select>
<input type="button" name="go_button" id= "go_button" value="Go" onclick="MM_jumpMenuGo('jumpMenu','parent',0)" />
</form>

molendijk
02-21-2012, 12:11 PM
See this (http://www.dynamicdrive.com/forums/blog.php?b=251).
===
Arie Molendijk.