Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2006
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Updated Values not Sent with JS Form Submit

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

    Before I submit the form with JS I update an input field with js like this:
    Code:
    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
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,918
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Seems odd, but you could try this:-

    Code:
    document.getElementById('IC_Checksum').value = data;
    setTimeout("imaginaryform.submit()",25);
    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

  • #3
    New Coder
    Join Date
    Dec 2006
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That did the trick, thanks


  •  

    Posting Permissions

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