How to submit a form through Javascript in an iPho

2019-09-06 11:08发布

问题:

I need to post a form loaded in UIWebview (iPhone sdk/Objective c) through Javascript injection. I used document.form.submit() which is not working.

回答1:

To access your form you need to pull it from the forms array. Use form's name attribute as array key.

This should look like:

document.forms['formName'].submit();