A form using JavaScript is very similar to one using a plain
form, but you have to decipher the script to know what's
happening. I can't.
For example, the SourceForge site has this javascript for
the 'My Favorites' drop down:
<script language="JavaScript" type="text/javascript">
<!--
function jump(targ,selObj,restore){ //v3.0
if (selObj.options[selObj.selectedIndex].value)
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
If you look at the form using this script (with extraneous
stuff removed):
This would submit the form to
"http://sourceforge.net//my/favorite_redirect.php" using
POST with:
location='/projects/htmlparser/'
navmenu=""
Submit="GO"
Logged In: YES
user_id=605407
A form using JavaScript is very similar to one using a plain
form, but you have to decipher the script to know what's
happening. I can't.
For example, the SourceForge site has this javascript for
the 'My Favorites' drop down:
<script language="JavaScript" type="text/javascript">
<!--
function jump(targ,selObj,restore){ //v3.0
if (selObj.options[selObj.selectedIndex].value)
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
If you look at the form using this script (with extraneous
stuff removed):
<form action="/my/favorite_redirect.php" method="POST">
<select name="navmenu" onChange="jump('parent',this,1)"
class="smfc0b">
<option value="">My Favorites</option>
<option value="/">SF.net Home</option>
<option value="/projects/htmlparser/">htmlparser</option>
etc...
</select>
<input type="image" border="0" name="Submit" value="GO"
alt="Go" width="30" height="20"
src="https://images-ssl.sourceforge.net/images/go.gif" >
</form>
This tells me that when you click on the drop down, the
value of the menu item (option), is used to form the url, so
for the htmlparser item:
onChange ('parent', this, 1)
->
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
-> eval (parent.location='/projects/htmlparser/')
This would submit the form to
"http://sourceforge.net//my/favorite_redirect.php" using
POST with:
location='/projects/htmlparser/'
navmenu=""
Submit="GO"
An example of using post for a form is provided on the Wiki,
(if somebody hasn't trashed it recently):
http://htmlparser.sourceforge.net/wiki/index.php/PostOperation