Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
10-23-2009, 07:31 PM #1
- Join Date
- Oct 2009
- Thanked 0 Times in 0 Posts
Button Value different then Display Value
Is there anyway to make a button value different then the Display value?
I am dynamically generating a list of names from a database. Each name has a checkbox next to it and an edit button next to each name. So I could check 5 names, click delete and they are all deleted. Or I could click edit next to name 1 and it would edit the name. However because I can't nest a form in a form, I have named all the buttons the same and process out what does what in the POST information. This means that the hidden fields associated with each line (or name) are replaced by whatever was dynamically generated last, so it always edits person 1 no matter which button I press. I am looking for some way to pass a value (without a hidden field as they won't work in dynamic generation). I thought that if you could use the "value" of the submit button, but I don't want the user seeing these numbers, I would rather them just see the words edit.
|CHECKBOX| FirstName1 LastName1 |EDIT BUTTON|
|CHECKBOX| FirstName2 LastName2 |EDIT BUTTON|
If "Delete Selected" then delete checkbox
If "edit" then edit USERID (which is always the last one generated)