Jump to content

Submit Form Id


Akshen

Recommended Posts

The input below works perfectly when inside the form I wish to submit, but I'd like to place it outside the <form> tags and use it to submit based on id/class to the seperate pages. Obviously the onChange needs to look something like "onChange=submit MyForm to location of value", how I do that in JS is the question. If anyone could shed some light on the issue, it'd be much appreciated!

 

<?php
echo "<select size=\"1\" onChange=\"this.form.action=this.options[this.selectedIndex].value;\">
<option>Submit to...</option>
<option value=\"index.php?q=". $_SESSION['nav_sid'] ."&page=1\">Page1</option>
<option value=\"index.php?q=". $_SESSION['nav_sid'] ."&page=2\">Page2</option>						
<option value=\"index.php?q=". $_SESSION['nav_sid'] ."&page=3\">Page3</option>
</select>

<form id=\"MyForm\">
<input type=\"text\" name=\"blah\" />
</form>";
?>

Link to comment
https://forums.phpfreaks.com/topic/171927-submit-form-id/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.