1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Two dropdown boxes

Discussion in 'JavaScript' started by zed420, Aug 11, 2009.

  1. #1
    Hi All
    I wonder if someone can help me i don't know much about JavaScript. I'm working on a PHP file, it has two dropdown boxes 'starttime' and 'endtime' I want it so that if someone selected 9am 'starttime' the 'endtime' should change to 10am onwards. so basiclly gap of 1hr. Is this possible with Javascript? many thanks
    Zed :confused:
     
    zed420, Aug 11, 2009 IP
  2. bholu

    bholu Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    soory not with php, can help u with javascript drop down boxes
     
    bholu, Aug 15, 2009 IP
  3. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #3
    yes it is possible. do both dropdowns. set value="13" etc on all hours. look for javascript dropdown onchange events on google - add one that then gets this.selectedIndex.value, does a parseInt on it, adds 1 or resets to 0 after 24, and then sets dropdown2's selectedindex/value to the new value.

    i wouldn't expect people to write the script for you though.
     
    dimitar christoff, Aug 15, 2009 IP