Forums

This topic is locked

Can you reuse HTML code? e.g. Menu(drop down)

Posted 18 Feb 2003 17:55:39
1
has voted
18 Feb 2003 17:55:39 Chris Rowe posted:
Here's my problem. I have a system where managers can create a schedule of all employees for the week. Depending on the amount of postitions needed scheduled, a page is created with:

a menu of all employees
monday(start,end)
tuesday(start,end)
wednesday(start,end)
thursday(start,end)
friday(start,end)
saturday(start,end)

Start and End are both menus as well, with this code:

<select name="m1sTime"
<option value="0"></option>
<option value="6.5">6:30a</option>
<option value="7">7a</option>
<option value="7.5">7:30a</option>
<option value="8">8a</option>
<option value="8.5">8:30a</option>
<option value="9">9a</option>
<option value="9.5">9:30a</option>
<option value="10">10a</option>
<option value="10.5">10:30a</option>
<option value="11">11a</option>
<option value="11.5">11:30a</option>
<option value="12">Noon</option>
<option value="12.5">12:30p</option>
<option value="13">1p</option>
<option value="13.5">1:30p</option>
<option value="14">2p</option>
<option value="14.5">2:30p</option>
<option value="15">3p</option>
<option value="15.5">3:30p</option>
<option value="16">4p</option>
<option value="16.5">4:30p</option>
<option value="17">5p</option>
<option value="17.5">5:30pm</option>
<option value="18">6p</option>
<option value="18.5">6:30p</option>
<option value="19">7p</option>
<option value="19.5">7:30p</option>
<option value="20">8p</option>
<option value="20.5">8:30p</option>
<option value="21">9p</option>
<option value="21.5">9:30p</option>
<option value="22">10p</option>
<option value="22.5">10:30p</option>
<option value="23">11p</option>
<option value="23.5">11:30p</option>
<option value="24">Mid</option>
</select>

The reason for the Start/End menu is because there needs to be an hourly calculation so I convert the times to military time. So as you can see if the manager chooses to create a schedule for 20 employees for the week this gets to be way too much code written and most computers will run out of memory.

Is there a way to reference the Start/End menu without actually inserting it into every place needed? Is there a symbol library similar to Flash that I could use? Or if you have any suggestions on this please let me know. Thanks!

Chris

Reply to this topic