The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form dropdown list
#5
I'm afraid I'm getting stuck. Here's where I am:
<label for="street">Residential address* (e.g. 1)</label>
<SELECT class="form-control" name="streetlist" form="payment-form">
<option value=""></option>
<option value="Street1">1</option>
<option value="Street2">2</option>
</SELECT>
<input class="form-control" maxlength="13" type="text" name="street" id="street" value="<?php if (!$form_valid && !empty($_POST)){ echo $street;} ?>" required >

I made the 1st <option> blank as an attempt to have the person select a street instead of leaving it at default.

The page still displays the original input field AND now a select box. So I remove the <input> section leaving:
<label for="street">Residential address* (e.g. 1)</label>
<SELECT class="form-control" name="streetlist" form="payment-form">
<option value=""></option>
<option value="Street1">1</option>
<option value="Street2">2</option>
</SELECT>

Now I've lost the php required validation. Some more messing around and found this to work:
<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>

Problem solved. Happiness. Well, almost Smile
  Reply


Messages In This Thread
Form dropdown list - by pierre - 08-30-2017, 05:57 PM
Form dropdown list - by Brandin - 08-30-2017, 10:14 PM
Form dropdown list - by mudmin - 08-30-2017, 10:40 PM
Form dropdown list - by pierre - 08-31-2017, 02:53 AM
Form dropdown list - by pierre - 08-31-2017, 05:58 AM
Form dropdown list - by pierre - 08-31-2017, 08:01 AM
Form dropdown list - by Brandin - 08-31-2017, 11:21 AM
Form dropdown list - by pierre - 08-31-2017, 01:58 PM
Form dropdown list - by pierre - 08-31-2017, 05:00 PM
Form dropdown list - by Brandin - 08-31-2017, 07:40 PM
Form dropdown list - by pierre - 09-01-2017, 04:15 AM
Form dropdown list - by pierre - 09-01-2017, 04:26 AM
Form dropdown list - by Brandin - 09-01-2017, 11:44 AM
Form dropdown list - by pierre - 09-01-2017, 06:59 PM
Form dropdown list - by karsen - 09-01-2017, 07:07 PM
Form dropdown list - by pierre - 09-01-2017, 07:13 PM
Form dropdown list - by Brandin - 09-01-2017, 07:59 PM

Forum Jump:


Users browsing this thread: 6 Guest(s)