#1
  1. Disturbed
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Somewhere In the Great Unknown
    Posts
    495
    Rep Power
    13

    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)
    Or
    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.
    D.

    The script i found is below.

    <html><head><script>
    <!--
    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;
    }

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

    <select name="century" onChange="dupdate()">
    <option>00
    <option>01
    <option>02
    <option>03
    <option>04
    <option>05

    </select>

    <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

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

    Join Date
    Aug 2002
    Location
    Vicksburg, MS
    Posts
    7
    Rep Power
    0
    I have used the calendar scripts at:
    http://www.softcomplex.com/products/tigra_calendar/

    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