Search code examples
htmlcheckboxuiwebviewradio-button

detect checkbox answer from objective c


I have an html containing radio buttons combo box, check box and input box. I run this html on uiwebview. I need a way to be able to know which answer the user has chosen.

How can I do that?


Solution

  • I found the way to do it if anyone faced the same problem, in fact you need to add to the html your running the following in the tag you define the checkbox:

      onclick ="checkboxClicked()"
    

    for example:

     <input type="checkbox" id="checkboxid" onclick ="checkboxClicked()"/>
    

    which will call the function checkboxClicked() once the checkbox is selected.

    You will implement this function in the JavaScript file that you will compile along with your html once you run it on the webview.