...

View Full Version : Updated Values not Sent with JS Form Submit



jeanpaul1979
12-06-2010, 05:36 PM
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:


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?

Philip M
12-06-2010, 05:41 PM
Seems odd, but you could try this:-


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.

jeanpaul1979
12-06-2010, 06:09 PM
That did the trick, thanks :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum