change the text box value according to select box option without using ajax

Discussion in 'JavaScript' started by learnerabn, Sep 23, 2010.

  1. #1
    Hi all,

    I am developing a site.
    In that i'm having a certain page that displays the packages detail in one div
    and in another div it will have a form their the users can select the package as per their wish.
    And their is a text box that should be filled with the selected package amount.
    My problem here is the amount should be retrived from the database.
    and i'm using jquery .change event to fill the text box.
    I dont want to use ajax since i dont want retrieve the data once again,which is already present in the package detail div.
    So can i have the data in any other way?
    I'm totally blank...
    Can any one suggest me any idea?

    Thanks in advance...
     
    learnerabn, Sep 23, 2010 IP
  2. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Just place the price say within a span tag>
    
    <span id="price">$99.99</span>
    
    Code (markup):
    Then you can easily retrieve this value without using AJAX.
    
    var price = document.getElementById("price").innerHTML;
    
    Code (markup):
     
    camjohnson95, Sep 26, 2010 IP
  3. learnerabn

    learnerabn Peon

    Messages:
    131
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you camjohnson95,

    But i'm having pagination for displaying package details.
    So i cant get the first package's detail in the second page...

    Can i get any other options?
     
    learnerabn, Sep 26, 2010 IP