emzi
08-11-2014, 08:36 AM
Hi All
Hopefully this is really simple but currently its not working. I am trying to get a popup box to appear if No Longer Required is selected as an OnChange event. If I take the If statement out the alert will work but I really need the condition in there.
function extracheck(form) {
if (form.Reason1.value == "No Longer Required"){
alert("message here");
}
}
<form id="form2" name="form2" method="post" action="returnprocess.asp" onSubmit="return validateForm(this)">
<select name="Reason1" class="textfieldmedium" id="Reason1" onchange="extracheck(this.form)">
<option selected="selected">Reason for Return</option>
<option>No Longer Required</option>
<option>Duplicated Order</option>
<option>Choice of Two</option>
<option>Incorrectly Supplied</option>
<option>Incorrect for Application</option>
<option>Incorrectly Packaged</option>
<option>Late Delivery</option>
<option>Incorrectly Picked</option>
<option>Never Ordered</option>
<option>Surcharge Unit</option>
<option>Damaged</option>
<option>Poor Fitment</option>
<option>Failed Emissions</option>
<option>Blowing Welds</option>
<option>Noise</option>
<option>Faulty</option>
<option>Cushion Fault</option>
</select>
Hopefully this is really simple but currently its not working. I am trying to get a popup box to appear if No Longer Required is selected as an OnChange event. If I take the If statement out the alert will work but I really need the condition in there.
function extracheck(form) {
if (form.Reason1.value == "No Longer Required"){
alert("message here");
}
}
<form id="form2" name="form2" method="post" action="returnprocess.asp" onSubmit="return validateForm(this)">
<select name="Reason1" class="textfieldmedium" id="Reason1" onchange="extracheck(this.form)">
<option selected="selected">Reason for Return</option>
<option>No Longer Required</option>
<option>Duplicated Order</option>
<option>Choice of Two</option>
<option>Incorrectly Supplied</option>
<option>Incorrect for Application</option>
<option>Incorrectly Packaged</option>
<option>Late Delivery</option>
<option>Incorrectly Picked</option>
<option>Never Ordered</option>
<option>Surcharge Unit</option>
<option>Damaged</option>
<option>Poor Fitment</option>
<option>Failed Emissions</option>
<option>Blowing Welds</option>
<option>Noise</option>
<option>Faulty</option>
<option>Cushion Fault</option>
</select>