SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Sep 20, 2002, 22:46 #1
- Join Date
- Oct 1999
- Location
- Vancouver, BC, Canada
- Posts
- 983
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
How to change "value" attribute AFTER submit button is pressed?
I have the following input tags that create two buttons with the labels of "Save" and "Preview". When either button is pressed the same form is submitted and the "action" variable will have the appropriate value depending on which button was pressed.
Code:<input type="submit" name="action" value="Save" style="width:150px;"> <input type="submit" name="action" value="Preview" style="width:150px;">
Basically, the button label needs to stay as they are but the value of the action variable needs to be something different. (I am unable to change the script..)
Can anyone show me how this can be done? I suspect some javascript on the onClick event would do it..
Thanks!
-
Sep 21, 2002, 02:31 #2
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
<input type="submit" name="action" value="Save" onClick="this.form.action='somepage.asp'">
-
Sep 21, 2002, 12:10 #3
- Join Date
- Oct 1999
- Location
- Vancouver, BC, Canada
- Posts
- 983
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by jofa
<input type="submit" name="action" value="Save" onClick="this.form.action='somepage.asp'">
Thanks!
-
Sep 21, 2002, 13:27 #4
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Like this?
<input type="submit" name="action" value="Save" onClick="this.value='Something else';">
Bookmarks