Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

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('update.jsp?orid=7&ac=u&cn=1')">
      <option value="1">Pending</option>
      <option value="2" SELECTED>Processing</option>
      <option value="3">Delivered</option>
   </select>
-----------------------------------------------

Also, is there a way to have the options say "yes" and "no" instead of "OK" and "Cancel" ?

Thanks!
Avatar of cLFlaVA
cLFlaVA

Question 1:

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.
ASKER CERTIFIED SOLUTION
Avatar of cLFlaVA
cLFlaVA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi hankknight,

    Question 2 : Working only with IE4+ use vbscript like :
    MsgBox("This orders status will be changed.", vbYesNo)

MrClean