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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.