Compacting <select> options |
Compacting <select> options |
Ann-Marie Foster |
May 9 2019, 02:31 AM
Post
#1
|
Group: Members Posts: 7 Joined: 5-August 18 Member No.: 26,686 |
We ship to about 65 countries.
The billing country and two shipping country entries are made with the <select> - - - </select> options, about 65 lines each. All 3 use exactly the same option list. Is there any way with CSS or ?? to save this list on one place to reduce the size of the code by 130 lines and facilitate edits? Thanks. |
Ann-Marie Foster |
May 9 2019, 09:47 AM
Post
#2
|
Group: Members Posts: 7 Joined: 5-August 18 Member No.: 26,686 |
Thanks, Christian.
It is all manually created and two more sets of 65 lines of text copy/pasted in but it just irks me when I see that much repetition in the code. There must be a neater way to do it . You can't call functions in HTML and you can't call a <select> in Javascript |
pandy |
May 9 2019, 09:53 AM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,736 Joined: 9-August 06 Member No.: 6 |
Don't you have access to PHP or at least SSI so you can use includes?
And you can populate a SELECT with JavaScript. I leave it to Christian to explain how though. But I'd go with an include. Much cleaner. |
Lo-Fi Version | Time is now: 8th June 2024 - 01:34 PM |