Checkbox from legacy html application.

Checkbox from legacy html application.

We have a legacy html application that has checkboxes that we are trying to capture the state when the information is submitted.  The information is submitted via a JQuery serialize ajax submit that sets the checkbox to 'checkboxname=on'.  Trying to turn that 'on' to a boolean in the database.  I have tried setting the oml input parameter to Boolean but the value continues to be zero.  Does anyone have suggestions on how to handle this?
Hi Scott,

It's hard for me to cacth the real issue without a eSpace sample... Could you provide some sample? 

Rafael Pereira
Hi Rafael,

The below code sumbits an html form to an oml web screen that has input parameters that match the names of the fields on the form.  Some of the fields are checkboxes and when checked appear as 'checkboxname=on' in the post string.  Trying to get the web screen to recognize the checkbox as checked and therefore a boolean 1.  So far I can only get a zero.

                        function (){
                              contentType: "application/json; charset=utf-8",
                              dataType: 'jsonp',
                              data: $("#Form1").serialize(),
                              url: 'http://servername/OMLName/WebScreenName.aspx'                              


Try setting the value on the checkbox to true.
Hi Scott,

First question: The other fields are "interpreted/receive" by the destination page and you are having only problems with checkbox?
Answer: Yes
Possible Solution: Change the corresponding input parameter to Text instead of Boolean and transform the "ON" on TRUE and "OFF" on "FALSE" by adding logic to the Preparation. 

Answer: No, I have the same problem with other fields submited...

Possible Solution: (Change the submit type from POST to GET)

First, let's make a test!

1) Change your Ajax submit url to:

url: 'http://servername/OMLName/WebScreenName.aspx?DummyBoolPar=True&DummyText=ABC'

2) Create two input parameters DummyBoolPar (boolean) and DummyText (text) on your WebScreenName page.
3) Deploy the code and using a breakpoint on your preparation logic check if your Ajax submit can send those two new variables and if you can correctly receive them.

The two new variables are submited by GET instead of POST...
Probably you'll have to change your Ajax function to submit the form data by GET instead of POST.

Maybe there is an override method for $("#Form1").serialize() to change this behavior. (POST » GET)

Rafael Pereira