
March 31st, 2000, 03:28 AM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,578
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
<i><b>Originally posted by : Chris Snider (csnider@worldnet.att.net)</b></i><br />Spencer,<br /><br />I agree with Steve that you need to find what you are most comfortable in doing.<br /><br />A method that I have used to great success is to use multiple submit buttons with different values, but the same name.<br />For instance:<br /><form method="post" action="myactionprocess.asp"><br /><input type="text" value="" size="25" name="imagedetail"><br /><select name="selectname"><br /><option value="value1">value1</option><br /><option value="value2">value2</option><br /><option value="value3">value3</option><br /></select><br /><INPUT type="submit" value="Add new" id="DataAction" name="DataAction"><br /><INPUT type="submit" value="Update" id="DataAction" name="DataAction"><br /><INPUT type="submit" value="Delete" id="DataAction" name="DataAction"><br /></form><br /><br />When any of the submit buttons is pressed, the same form action is fired, and the receiving asp file only gets the value of the DataAction that was actually pressed. You can then do like you specified and use a Select Case like the following:<br />Dim DataAction<br />DataAction = LCase(Request("DataAction"))<br />Select Case DataAction<br />Case "update"<br /> Call UpdateFunction()<br />Case "add new"<br /> Call AddNewFunction()<br />Case "delete"<br /> Call DeleteFunction()<br />End Select<br /><br />If you need further explanation or have other questions, please email me.<br /><br />Chris Snider<br /><br />------------<br />steve at 3/28/2000 5:14:14 AM<br /><br />you have to find out whats most comfortable to you. BUT what you've described is very clean efficient coding. one of the demo's on asp free has multiple buttons on one form. i found this to be a very clean, efficient way of coding. only took me awhile to learn it! Good luck on your ventures. http://www.aspfree.com/asp/startpage.asp?id=37<br />here is the link to the demo on multiple buttons and how i did. its very basic but gives you an idea.<br /><br />steve<br />webmaster<br />aspfree.com<br /><br /><br />------------<br />Spencer Hopkinson at 3/28/2000 1:00:38 AM<br /><br />Hi there,<br /><br />I work for an eCommerce company and I am a VB / C++ developer who is being pushed in an ASP direction!!<br /><br />I have several maintenance forms consisting of combos and text details for the item selected from the combo.<br /><br />I have also Add New , update and delete image buttons on the form. When I select an action from the buttons I populate a hidden HTML field with the action via some JAVA code e.g "ADDNEW".<br />I then select case for the value in request.form("HideAction") and do action accordingly. Is this a respectable method to do things or do I speak the words of a crazy man?!?!? Pointers / advice would be greatly appreciated!!
|