Cleaner way

  • gophw1
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Dec 11, 2012
  • Posts: 12
  • Status: Offline

Post February 26th, 2013, 4:49 pm

Looking to add a drop down box in a form that lists the 50 states, is there a cleaner way to do this other than
<form action="./" method="GET">

<select name="state">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>

etc,etc,etc

I'm sure there is a way to do it to eliminate 50 lines of code.

Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 26th, 2013, 4:49 pm

  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 6128
  • Loc: Seattle, WA
  • Status: Offline

Post February 26th, 2013, 5:28 pm

Not really. Even if you store the actual state data (names and abbreviations) elsewhere, your final rendered page will still contain what you've described above.

Why do you feel the need to eliminate this code? What do you gain by doing so?
The Beer Monocle. Classy.
  • gophw1
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Dec 11, 2012
  • Posts: 12
  • Status: Offline

Post February 26th, 2013, 5:33 pm

I don't want to eliminate it per say, I'm learning new languages and thought there might be a new way instead of this.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: Bigwebmaster and 215 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.