I have a textbox...named "bnBookingStatus"..
- Code: Select all
<input id="status" type="text" name="bnBookingStatus" size="35" value="<%=(conformBookingBN.Fields.Item("bnBookingStatus").Value)%>" readonly>
The text box is disable from user input, but i proved a text button to change the value inside it!
- Code: Select all
[Approve]
[Disapprove]
[Pending]
and i have another textbox, named "reason"..
- Code: Select all
<input id="reason" type="text" name="bnReason" size="35">
What i want to do is...
I want to create a javascript alert message if the value in the two textbox is like the LOGIc below when i trying to submit the form:-
bnBookingStatus="DISAPPROVE" && reason=""
If "bnBookingStatus" textbox value is "DISAPPROVE" and "reason" textbox value is empty,""
then alert that user to fill in the "reason" textbox!
alert("You must specify the disapproval reason!");
If the "bnBookingStatus" textbox value is "APPROVED",
then set the value of the textbox "reason" to be "YOUR BOOKING HAS BEEN PROCESSED!"
If it is pending, DO NOTHING!