Sunday, 29 September 2013

How can I have multiple condition in 1 if statement

How can I have multiple condition in 1 if statement

I'm trying to hide a button until both select boxes have an item select.
<select id="comType">
<option>-- Select --</option>
<option>Call</option>
<option>Fax</option>
<option>Email</option>
</select>
<select id="comDirection">
<option>-- Select --</option>
<option>Incoming</option>
<option>Outgoing</option>
</select>
<a href="#"
id="button_that_displays_only_when_both_selects_have_input">Next</a>
What I'm currently using, but I know is not right.
<script>
$(document).ajaxSuccess(function () {
if ($("#comType").change()) || ($("#comDirection").change()))
{ $("#button_that_displays_only_when_both_selects_have_input").show()}
});
</script>
It would be an added bonus if this could ensure actual selection, as in,
not allow the first select option to count as they are just
placeholders....
Thanks, Mark

No comments:

Post a Comment