Can a field communicate to a server and return information to another field without retrieving the whole html code again?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • marcelf3@yahoo.com

    #1

    Can a field communicate to a server and return information to another field without retrieving the whole html code again?

    I´ve got a sql table which has 3 fields.
    Their relation to each other is like this example.

    | CARS | YEAR | PRICE |
    ford 2000
    ford 2001
    ford 2003
    volkswagen 1999
    volkswagen 2000

    I am developing an ASP web page that modifies a specific registry.
    So, it loads the information to some fields, but the user will be able
    to change only the "PRICE" field.
    I have to create two selects, one for "CARS" and other for "YEAR".
    But the "YEAR" field will only contain the correspondent years for each
    car the user selects. Example: selecting "ford" in the "CARS" <select>
    box, only the years "2000", "2001", "2003" would be automatically
    loaded in the "YEAR" <selec> box.
    How could i implement it? All sorts of suggestions will be welcome.
    Thanks in advance.
    Marcel;.

  • R. Rajesh Jeba Anbiah

    #2
    Re: Can a field communicate to a server and return information to another field without retrieving the whole html code again?

    marce...@yahoo. com wrote:[color=blue]
    > I´ve got a sql table which has 3 fields.
    > Their relation to each other is like this example.
    >
    > | CARS | YEAR | PRICE |
    > ford 2000
    > ford 2001
    > ford 2003
    > volkswagen 1999
    > volkswagen 2000
    >
    > I am developing an ASP web page that modifies a specific registry.
    > So, it loads the information to some fields, but the user will be[/color]
    able[color=blue]
    > to change only the "PRICE" field.
    > I have to create two selects, one for "CARS" and other for "YEAR".
    > But the "YEAR" field will only contain the correspondent years for[/color]
    each[color=blue]
    > car the user selects. Example: selecting "ford" in the "CARS"[/color]
    <select>[color=blue]
    > box, only the years "2000", "2001", "2003" would be automatically
    > loaded in the "YEAR" <selec> box.
    > How could i implement it? All sorts of suggestions will be welcome.[/color]

    No idea, why did you post here in c.l.php while programming in ASP.
    Anyway...
    1. Pure PHP way: Put 2 or 3 steps so that you get user inputs from each
    step like Cars in first step, year in second step, etc.
    2. Create on the fly JavaScript code using PHP. The JS code then should
    work in such a way that if you choose cars, it has to populate year in
    another select list.
    3. JavaScript + PHP with XMLHttpRequest technique
    <http://jibbering.com/2002/4/httprequest.htm l>
    4. Combination of above.

    p.s.: Google to find more resources.

    --
    <?php echo 'Just another PHP saint'; ?>
    Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

    Comment

    • Kartic

      #3
      Re: Can a field communicate to a server and return information to another field without retrieving the whole html code again?

      Marcel -

      If you are interested in a technique, phpbuilder.com also has an
      article on how to dynamically populate drop-downs. You may not know PHP
      but the article is straightforward to understand and you should be able
      to extrapolate the concept to ASP.

      Otherwise, sleep on Rajesh's great suggestions.

      And, please do not cross-post to so many groups! Posting to more groups
      does not mean you will get better responses. Just a friendly advise so
      that you don't upset people all over the world.

      Thanks,
      --Kartic

      Comment

      Working...