The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Compacting <select> options
Ann-Marie Foster
post 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.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Ann-Marie Foster
post 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 smile.gif.

You can't call functions in HTML and you can't call a <select> in Javascript sad.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post 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. biggrin.gif
But I'd go with an include. Much cleaner.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 8th June 2024 - 01:34 PM