| Store | Cart

html tags and python

From: EP <E...@zomething.com>
Sat, 26 Mar 2005 18:07:01 -0800
 
>  <select>>         <option name = "1" value="1">January>         <option name = "2" value="2">February>         <option name = "3" value="3">March>         <option name = "4" value="4">April>         <option name = "5" value="5">May>         <option name = "6" value="6">June>         <option name = "7" value="7">July>         <option name = "8" value="8">August>         <option name = "9" value="9">September>         <option name = "10" value="10">October>         <option name = "11" value="11">November>         <option name = "12" value="12">December>         </select>> > The thing is:> I also want the user to choose a date> I will make this with another dropdownbox.> But if the first month is selected, then there should be 31 days in the > days> dropdownbox, if the second month is selected there should be 28 days in > the> dropdownbow.


Python is great, but I'd suggest trying this with JavaScript and the DOM (Document Object Model).  In fact you may be able to Google-up a JavaScript script that does what you want.  JavaScript executes on the client machine, which is perfect for that aspect of your application.

The general idea would be to have the script redefine the option values for days upon selection of the year and month.  The DOM lets you access those <option>s at run time very easily.

JavaScript is not as robust a programming language as Python, but it is handy for executing certain functionality within a browser interface, and because it works within the browser and can access the DOM, there is an element of instant gratification.

Then... about the time you start to try to build a real application with JavaScript, it will start to drive you mad... and you will have a new, greater affection for Python.

Recent Messages in this Thread
Hansan Mar 25, 2005 10:16 pm
Kane Mar 25, 2005 11:46 pm
Hansan Mar 26, 2005 12:13 am
Swaroop C H Mar 28, 2005 02:27 pm
Dan Bishop Mar 26, 2005 03:46 am
Tim Roberts Mar 26, 2005 09:12 am
Hansan Mar 26, 2005 10:57 am
Patrik Andreasen Mar 26, 2005 11:38 am
gene...@gmail.com Mar 26, 2005 11:49 am
Hansan Mar 26, 2005 03:40 pm
gene...@gmail.com Mar 26, 2005 05:09 pm
EP Mar 27, 2005 02:07 am
Timo Virkkala Mar 30, 2005 05:38 pm
Jeremy Bowers Mar 27, 2005 02:25 am
Hansan Mar 28, 2005 08:12 am
Hansan Mar 28, 2005 04:25 pm
Messages in this thread