update text box with cookie

Discussion in 'JavaScript' started by gvm, Dec 11, 2006.

  1. #1
    I have a hidden text box that is updated with cookie info on a click event-- Place Order link. The info value is correct but is only updated in the text box if I click on the browser refresh button and then click on the Place Order link on my cart page. I want the textbox to update after I click on the Place Order link without having to refresh the browser button. I'm not sure how to fix this.
     
    gvm, Dec 11, 2006 IP
  2. j4s0n

    j4s0n Guest

    Messages:
    295
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hrrmmm, from what I know..... you can't, because the cookie's new value will only load soon on the next browser refresh.

    And why cookies? why don't you just place the the value directly to the hidden textbox on the click event. Oh welp, anyway... It's your call :)
     
    j4s0n, Dec 12, 2006 IP
  3. gvm

    gvm Guest

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Tried that...won't work...tried using arrays and variables but they return the generic messages of undefined, null values, or not an object.The info comes across other pages and cookies are the only way that will let me do that as far as I know.
     
    gvm, Dec 12, 2006 IP
  4. lbalance

    lbalance Peon

    Messages:
    381
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #4
    if its a PHP page, just use the PHP cookie call to load the data into the hidden field when the page loads
     
    lbalance, Dec 12, 2006 IP
  5. gvm

    gvm Guest

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the info. At the present I'm not using PHP for storing data. I found that the cookie is returning data to the hidden text field using HTML meta tag to refresh the page as soon as the page is loaded. So for now I'll use the tag for the page update. Again thanks.
     
    gvm, Dec 12, 2006 IP
  6. j4s0n

    j4s0n Guest

    Messages:
    295
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    oic good luck to your code then. :) I love cookies but only the ones i can eat :)
     
    j4s0n, Dec 13, 2006 IP
  7. weknowtheworld

    weknowtheworld Guest

    Messages:
    306
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks!!! useful info for me too..
     
    weknowtheworld, Dec 22, 2006 IP