08-31-2017, 08:01 AM
OK, problem not solved. On testing my solution above:
<label for=”street”>Residential address* (e.g. 1 Douglas Carr)</label>
<SELECT class=”form-control” name=”streetlist” form=”payment-form” value=”<?php if (!$form_valid && !empty($_POST)){ echo $street;} ?>” required >
<SELECT class=”form-control” name=”streetlist” form=”payment-form”>
<option value=””></option>
<option value=”Street1″>1</option>
<option value=”Street2″>2</option>
</SELECT>
I now get error "Street is required". This is presumably because the php required check is before the <select>.
I'm in your hands, folks - how to get the <select> to work with validation? I will need the exact code I think.
Thanks!
<label for=”street”>Residential address* (e.g. 1 Douglas Carr)</label>
<SELECT class=”form-control” name=”streetlist” form=”payment-form” value=”<?php if (!$form_valid && !empty($_POST)){ echo $street;} ?>” required >
<SELECT class=”form-control” name=”streetlist” form=”payment-form”>
<option value=””></option>
<option value=”Street1″>1</option>
<option value=”Street2″>2</option>
</SELECT>
I now get error "Street is required". This is presumably because the php required check is before the <select>.
I'm in your hands, folks - how to get the <select> to work with validation? I will need the exact code I think.
Thanks!