Click to See Complete Forum and Search --> : how do you do this drop box?


Kommi
04-21-2003, 06:36 PM
http://app.ishape.com/ishape/go.nd/ishapesignup/pgPersonalInfo.1050960223049
at this link there is a form where the year selection is a drop down box with like 80 options. How do I do this drop down box? I know that it is unfeasable to do it as a simple html form (that would take forever). Any adivce or code examples greatly appreciated

Jona
04-21-2003, 06:44 PM
You mean a Javascript that creates new options in a select box? To me, it looks like they wrote out every date on there.

Kommi
04-21-2003, 07:51 PM
Isnt there a better way than writing every date out? Something with arrays maybe?

Oh nevermind I see that they did write it out

DrDaMour
04-21-2003, 08:05 PM
<form...>
<select...>

<script>
for(var i = 1900;i<1991;i++){
document.write('<option value="' + i + '">' + i + '</option>');
}
</script>
</select>

they didn't write it out, they used this same loop but in a cgi or php script

Jona
04-21-2003, 08:45 PM
Like I said, it looks like they wrote it out. I didn't think about the fact that they used server-side... But then again, I should've thought more about the URL... :p