Jump to content


Photo

How can I bypass the Submit button


  • Please log in to reply
3 replies to this topic

#1 sjones

sjones
  • Members
  • PipPipPip
  • Advanced Member
  • 42 posts

Posted 06 April 2006 - 06:04 PM

I would like to be able to select form data and send it to the next part of the script without using a submit button. I would like to just click or double click the selection in the menu list and then post that data to the next section of the script is this possible.

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 06 April 2006 - 06:19 PM

By form data do you provide input boxes for users to input data? Or do have pull down menus that have predefined data and when a user choses an option from the menu you would like it auto submit the form?

#3 sjones

sjones
  • Members
  • PipPipPip
  • Advanced Member
  • 42 posts

Posted 06 April 2006 - 06:29 PM

OK, The data will come from a list menu. this is the code - you can view how it functions now by going to
[a href=\"http://www.countrysavingsmagazine.com/master_coupon.php\" target=\"_blank\"]http://www.countrysavingsmagazine.com/master_coupon.php[/a]
I'm not sure if there has to be something added to the <head> of the page??

<?php include ('connections/mysql_connect.php');
$row_query = mysql_query("SELECT * FROM categories;");
$row_number = mysql_num_rows($row_query); ?>
<?php
echo "<form name='form1' method='post' action='master_coupon.php'>
<select name='cat_id' size='".$row_number."' onChange='MM_jumpMenu('parent',this,0)'>";
$qry = mysql_query("SELECT * FROM categories;");
while($rows = mysql_fetch_assoc($qry)) {
echo "<option value='".$rows['cat_id']."'>".$rows['cat_name']."</option>\n";
}
?>
</select><br>
<br>
<input name='submit' type='submit' value='Select Category'>
</form>



#4 Malkavbug

Malkavbug
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 06 April 2006 - 07:51 PM

this is from one of my pages

The Drop Down Box

<td align="right" valign="bottom" class="jumpto">
<select style="font-size:9;" name="choice" onChange="jump(this.form)">

<option>Go to...</option>
<option value="private.php">Private Messages</option>
<option value="private.php?do=send">Send PM</option>
</select>
</td>

Header javascript

<script LANGUAGE="JavaScript" type="text/javascript">
<!--
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf("*");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000);}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
//-->
</SCRIPT>

Now, this will allow you to enable a navigation based on it, and if you use $_GET in urls as the variables then you can just have things print to the URL, like I have in the above example "private.php?do=send"

That maybe what you were going for? If you had subcategories you could chain this system together to lower sub levels.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users