hankknight
asked on
Yes/No Conformation Box for onChange
Hello.
The following gives a conformation box, but the status is still changed, even if the user hits "cancel":
-------------------------- ---------- ---------- -
<select name="status1"
onChange="confirm('This order\'s status will be changed.');passthis('updat e.jsp?orid =7&ac=u&cn =1')">
<option value="1">Pending</option>
<option value="2" SELECTED>Processing</optio n>
<option value="3">Delivered</optio n>
</select>
-------------------------- ---------- ---------- -
Also, is there a way to have the options say "yes" and "no" instead of "OK" and "Cancel" ?
Thanks!
The following gives a conformation box, but the status is still changed, even if the user hits "cancel":
--------------------------
<select name="status1"
onChange="confirm('This order\'s status will be changed.');passthis('updat
<option value="1">Pending</option>
<option value="2" SELECTED>Processing</optio
<option value="3">Delivered</optio
</select>
--------------------------
Also, is there a way to have the options say "yes" and "no" instead of "OK" and "Cancel" ?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi hankknight,
Question 2 : Working only with IE4+ use vbscript like :
MsgBox("This orders status will be changed.", vbYesNo)
MrClean
Question 2 : Working only with IE4+ use vbscript like :
MsgBox("This orders status will be changed.", vbYesNo)
MrClean
Check out this code. It will set the value back to the previous value if user hits Cancel.
Question 2:
Not unless you create a custom page and use window.open. Not worth the effort.