1. Disturbed
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Somewhere In the Great Unknown
    Rep Power

    Display from values

    I am not sure if this is the right place to put this but here i go...

    I want to create a field that displays values from 3 drop down menus..
    This is a script (bottom of page) i have seen but this adds values together, and i just want to show them EG:

    drop down 1 day with values 1,2,3,4,5,6.......30
    drop down 2 month with values 1,2,3,4,5,6.....12
    drop down 3 year with values 2003,2004........2008

    The field will show either:
    1/1/2003 (okay)
    1st Jan 2003 (excelent)

    What would be really cool but i'm not sure if it could be done is if it could show:

    Monday 1st Jan 2003

    but thats purely a bonus.

    I want to do the same thing with a time.

    The script i found is below.

    function dupdate()
    var ndate="";

    ndate = document.tycform.century.selectedIndex * 100 +

    (document.tycform.year.selectedIndex % 100);
    document.tycform.display.value = ndate;
    document.tycform.month.value = ndate;

    <center><FORM name="tycform" METHOD="GET" ACTION="/cgi-bin/tyc.pl" target="tyc2">

    <select name="century" onChange="dupdate()">


    <SELECT NAME="year" onChange="dupdate()">
    <OPTION value="0">00
    <OPTION value="1">01
    <OPTION value="2">02
    <OPTION value="3" SELECTED>03
    <OPTION value="4">04
    <OPTION value="5">05
    <OPTION value="6">06
    <OPTION value="7">07

    <script language="javascript">
    document.write("Selected:<input type=text name=display size=4 onFocus=blur()>");
    // -->
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Vicksburg, MS
    Rep Power
    I have used the calendar scripts at:

    They work just fine in an html form to fill in a date field by clicking graphically on a calendar.

    I think this approach is superior to menu drop downs to construct a date.

    There's a demo on that page.
    It was simpler to just use what already worked.

IMN logo majestic logo threadwatch logo seochat tools logo