SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2007
    Posts
    130
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Updated Values not Sent with JS Form Submit

    Hi, I'm having a little trouble with this here...

    Before I submit the form with JS I update an input field with js like this:
    Code:
    document.getElementById('IC_Checksum').value = data;
    imaginaryform.submit();
    The problem is that the updated value is not sent along with the post data. Instead the old value is sent along.

    When i submit the form with a button afterwards though (not auto submit after the value is set), then the value is sent along fine.

    But that's not how I want it to work...

    Can anyone tell me how I can send the value that I'm setting with JS along with the post data like this?

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2007
    Posts
    130
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Philip over at codingforums helped me with this, here's the solution:

    document.getElementById('IC_Checksum').value = data;
    setTimeout("imaginaryform.submit()",25);


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •