Jump to content

problem with submit button


geroido

Recommended Posts

Hi can anyone take a look at this please. The very first submit button name='edit' has stopped working for some reason. The cancel submit button is fine and the last two submit buttons in the code are ok also. Just the first one stopped working and is innactive on the page (no arrow appearing over it from the mouse unlike the others). Are the form tags in the right place?

 

<?php 
if (($_SESSION['type'] == "Delivery and restaurant booking") || ($_SESSION['type'] == "Delivery only") || ($_SESSION['type'] == "Restaurant booking only"))
{
$query = "select MenuItemID, MenuItemName,  MenuItemDesc, MenuItemCost FROM menuitemdetails where MenuItemID = '".$_SESSION['menueditid']."'";
$results = mysql_query($query, $link) or die("Sorry, but you have no orders for today"); 

if(mysql_num_rows($results) > 0){ 

while($row = mysql_fetch_object($results)){ 
?>

<form method="post" name="editmenu" action="submitmenuedit.php">
<TABLE><TR><TD>EDIT MENU ITEM</TD></TR>
<TR><TD>Menu Item Name</TD></TR>
<TR><TD><textarea name="name" cols="50" rows="5"><?echo $row->MenuItemName?></textarea><br></TD>
<TR><TD>Decription</TD></TR>
<TR><TD><textarea name="desc" cols="50" rows="5"><?echo $row->MenuItemDesc?></textarea><br></TD></TR>
<TR><TD>Price</TD></TR>
<TR><TD><input type="text" name="price" size=15 value=<?echo $row->MenuItemCost?>></TD></TR>
<TR><TD>Menu Type</TD></TR>
<TR><TD><select name="itemtype">
        	<option value="">Select menu type</option>
        <option value="Starter">Starter</option>
        <option value="Main Courses">Main Courses</option>
        <option value="Desserts">Desserts</option>
        <option value="Beverages">Beverages</option>
        <option value="Extras">Extras</option>
        <option value="Miscellaneous">Miscellaneous</option>
   		</select></TD><TR></TR>
   </TABLE><TABLE><TR><TD><BR><input id="inputsubmit1"  "type="submit" name="edit" value="Submit item changes" /></TD>
   <TD><BR><input id="inputsubmit1" type="submit" name="cancel" value="Cancel" /></TD></TR>
  </TABLE></FORM><?

}
} 
}
  if  ($_SESSION['type'] == "Off Lisc")
  {     
$query = "select itemID, name,  measure, quantity, cost FROM drinks where itemID = '".$_SESSION['menueditid']."'";
$results = mysql_query($query, $link) or die("Sorry, but you have no orders for today"); 

if(mysql_num_rows($results) > 0){ 

while($row = mysql_fetch_object($results)){ 
?>

<form method="post" name="editmenu" action="drinkssubmitmenuedit.php">
<TABLE><TR><TD>EDIT STOCK ITEM</TD></TR>
<TR><TD>PRODUCT Name</TD></TR>
<TR><TD><textarea name="name" cols="50" rows="5"><?echo $row->name?></textarea><br></TD>
<TR><TD>MEASURE</TD></TR>
<TR><TD><textarea name="desc" cols="50" rows="5"><?echo $row->measure?></textarea><br></TD></TR>
<TR><TD>QUANTITY</TD></TR>
<TR><TD><input type="text" name="price" size=15 value=<?echo $row->quantity?>></TD></TR>
	<TR><TD>PRICE</TD></TR>
<TR><TD><input type="text" name="price" size=15 value=<?echo $row->cost?>></TD></TR>

<TR><TD>Menu Type</TD></TR>
<TR><TD><select name="itemtype">
        	<option value="">Select menu type</option>
        <option value="Beers">Beers</option>
        <option value="Wines">Wines</option>
        <option value="Spirits">Spirits</option>
        <option value="Soft drinks">Soft drinks</option>
        <option value="Alcopops">Alcopops</option>
   		</select></TD><TR></TR>
   </TABLE><TABLE><TR><TD><BR><input id="inputsubmit1" type="submit" name="edit" value="Submit item changes" /></TD>
   <TD><BR><input id="inputsubmit1" type="submit" name="cancel" value="Cancel" /></TD></TR>
  </TABLE></FORM><?

}
} 
}

?> 

Link to comment
https://forums.phpfreaks.com/topic/119831-problem-with-submit-button/
Share on other sites

Thanks that did the trick for that. The button is now active, but there is another problem. It's not redirecting to the page dictated in the form tag (submitmenuedit.php). This worked before and now it's not. Can you see a problem. This page exists.

 

if(mysql_num_rows($results) > 0){ 

while($row = mysql_fetch_object($results)){ 
?>

<form method="post" name="editmenu" action="submitmenuedit.php">
<TABLE><TR><TD><H3>EDIT MENU ITEM</H3></TD></TR>
<TR><TD><h3>Menu Item Name</H3></TD></TR>
<TR><TD><textarea name="name" cols="50" rows="5"><?echo $row->MenuItemName?></textarea><br></TD>
<TR><TD><H3>Decription</H3></TD></TR>
<TR><TD><textarea name="desc" cols="50" rows="5"><?echo $row->MenuItemDesc?></textarea><br></TD></TR>
<TR><TD><H3>Price</H3></TD></TR>
<TR><TD><input type="text" name="price" size=15 value=<?echo $row->MenuItemCost?>></TD></TR>
<TR><TD><H3>Menu Type</H3></TD></TR>
<TR><TD><select name="itemtype">
        	<option value="">Select menu type</option>
        <option value="Starter">Starter</option>
        <option value="Main Courses">Main Courses</option>
        <option value="Desserts">Desserts</option>
        <option value="Beverages">Beverages</option>
        <option value="Extras">Extras</option>
        <option value="Miscellaneous">Miscellaneous</option>
   		</select></TD><TR></TR>
   </TABLE><TABLE><TR><TD><BR><input id="inputsubmit1" type="submit" name="edit" value="Submit item changes" /></TD>
   <TD><BR><input id="inputsubmit1" type="submit" name="cancel" value="Cancel" /></TD></TR>
  </TABLE></FORM><?
}
} 
}

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.