sjones Posted April 6, 2006 Share Posted April 6, 2006 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. Link to comment https://forums.phpfreaks.com/topic/6746-how-can-i-bypass-the-submit-button/ Share on other sites More sharing options...
wildteen88 Posted April 6, 2006 Share Posted April 6, 2006 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? Link to comment https://forums.phpfreaks.com/topic/6746-how-can-i-bypass-the-submit-button/#findComment-24542 Share on other sites More sharing options...
sjones Posted April 6, 2006 Author Share Posted April 6, 2006 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> Link to comment https://forums.phpfreaks.com/topic/6746-how-can-i-bypass-the-submit-button/#findComment-24547 Share on other sites More sharing options...
Malkavbug Posted April 6, 2006 Share Posted April 6, 2006 this is from one of my pagesThe 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. Link to comment https://forums.phpfreaks.com/topic/6746-how-can-i-bypass-the-submit-button/#findComment-24573 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.