Reputation:
I want to make a button in UI iphone (not web iphone) to submit a form (with elements) to Javascipt like the mention below:
I have already a javascript file in my page: htpp:/www.myaddress/myfile.js This javascript contain a function called "doTransmit(PIOform)".
I want to create a form in UI iphone application consists some fields: txtField1, txtField2,.. and a button. That UI form like a html form below:
< form name=PIOForm action="server_address" >
< input type="text" name="txtField1">
......
< / form>
< input type="submit" value ="submit" >
when i click that UI button, it will call doTransmit(PIOform) function from javascript myfile.js above. (note: myfile.js will get and process parameters from UI iphone)
How can i do with button to submit UI form to javascript? Please help me.
Thank you so much.
Upvotes: 0
Views: 1365
Reputation: 75058
Why are you not just using NSURLConnection to submit the form data? You'd have to populate the data in the Javascript form anyway, so it's not like using the javascript to do the submit is saving you anything.
A UIWebView allows you to call javascript methods if you wish, but it's very unlikely you really want to do that.
Upvotes: 1