Using javascript to change POST data

I’ve been bashing my head against the wall for hours trying to figure this one out. I’m using a Rabbit Core 4000 module. I have a form that uses the HTML POST method to get the data to the C program (using #web_update). It works flawlessly as long as I call it directly:


If I click “Submit” all works as expected. The rabbitweb variable contains the value from field1.

Now, if I write a basic javascript handler for the form:

function javaSubmit() {
  document.myForm.submit();
}

That also works as planned. Calling that function activates my callback function in C and I get the “field1” variable updated.

However, if I try this:

function javaSubmit() {
  document.myForm.field1.value = "B";
  document.myForm.submit();
}

The callback function is never called and the data is not submitted to the C program.

Note that I tried the same exact program using an Apache web server and PHP to read the POST variable, and it is correctly updated. So why isn’t the Rabbit module picking up the changes?

ED

Ed,

That seems rather strange, as far as i can tell things look fine. I would recommend looking at the rsi_sample application. It also uses javascripts to post back data to RabbitWeb. It may shed some light on the problem you are seeing.

Regards

Ed,
I would also recommend installing the IE7 fiddler plug-in so you can see exactly what the browser is posting back. From the looks of your two examples I don’t think there will be a formatting difference in the posted data that would cause RabbitWeb to not update the variable, but its worth a try.

Regards

I’ll take a look at the rsi_sample and see what that does. But I don’t use IE (I try and avoid IE unless my life depends on it!). However I did find a plugin for Firefox called “Firebug” that seems to do the same thing. I’ll work with that today as well.

Thanks for the info!

ED