开发者

Fill HTML Form and get result of a javascript function iphone sdk

I had searched in any way to resolve my problem but nothing!

I have this web page with this field:

<form method="post" name="form_verifica" action="popup.jsp">
<input name="cod" type="text"  >
<td id="code" name="code" >
<input name="conc" type="text" >
<input src="" onclick="return checkcode();"  type="image">

Ho开发者_JAVA百科w can I fill "cod" and "conc" field and then Call checkcode() function? I Have tried this:

NSURL *url = [NSURL URLWithString: @"MioURL/popup.jsp"];
    ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
    [request setPostValue:[NSString stringWithString: Codice.text] forKey:@"cod"];
    [request setPostValue:[NSString stringWithString: Concorso.text] forKey:@"conc"];
    [request startSynchronous];

What i wrong?

Apologize me for my bad english. Thanks in advance!


To make it simple, give the input elements ids, and then load their values something like this:

NSString *myFieldValue = [webView stringByEvaluatingJavaScriptFromString:
    @"document.getElementById('myField').value;"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜