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.

form field

Discussion in 'JavaScript' started by chxxangie, Jan 4, 2009.

  1. #1
    my problem is, i have a form submission which contain some fields.
    one of the field is the student ID. then the following field is the course which are taken by that student.
    so the flow is user select student ID, then when move to next field (course), it will retrieve the list of course which in database base on the student ID.
    i m using PHP, but in this case, i need to get the user input before submit the form.
    can javascript do this? if can, how to do this? i have no idea on this...
    thanks in advance...
     
    chxxangie, Jan 4, 2009 IP
  2. cont911

    cont911 Peon

    Messages:
    50
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    read this article for the idea
    http://www.xml.com/pub/a/2005/02/09/xml-http-request.html

    what you need is to do the following
    1. once ID is updated, call special php page - courses.php, which return list of courses (use XMLHttpRequest object)
    2. implement courses.php - get student id from as a get parameter and quiry db for list of courses, pack into xml and return result to client
    3. parse resulting XML on client and update courses list
     
    cont911, Jan 4, 2009 IP