[Seaside] [Select Tag] setting option text

sergio ruiz sergio.rrd at gmail.com
Sat Jan 26 06:32:05 UTC 2019


I am creating a select for options like:

- 25 miles
- 50 miles
- 75 miles
- 100 miles

The miles part, i don’t want, i just want the value..

i am currently setting list: for an array of the above values..

i get:

<select id="selectDistance" class="form-control" name="2”>
<option value="1">25 Miles</option>
<option value="2">50 Miles</option>
<option value="3">75 Miles</option>
<option value="4">100 Miles</option>
</select>

i am wondering if i could do something that would allow me to set the value
and the text..

so the value would be 25 or 50, etc..
and the text in the option would be 25 miles, 50 miles, etc..

so i would  get:

<select id="selectDistance" class="form-control" name="2”>
<option value=“25">25 Miles</option>
<option value=“50">50 Miles</option>
<option value=“75">75 Miles</option>
<option value=“75">100 Miles</option>
</select>

so setting the selected: 50 would mark the appropriate option as selected.

Thanks!

Thanks!

----
peace,
sergio
photographer, journalist, visionary

Public Key: http://bit.ly/29z9fG0
#BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
http://www.codeandmusic.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20190125/d5ed8b32/attachment.html>


More information about the seaside mailing list