views:

49

answers:

3

i hav a html tags stored in string and i want to load the table with the attributes which i given dynamically through program...

how to search the particular tags of the row and column of html and add the data to the attributes...

any help appreciated...

Thanks in advance......

A: 

Hi.. specify ID's or class names for HTML tags, and then update it using javascript or DOM. ex:

HTML code:

Javascript Code:

document.getElementByid("tab1").value = Text in Box1
document.getElementByid("tab2").value = Text in Box2

Noddy Cha
can u give me example ..i hav tags for html table view and i want to load the td values with data attributes
lak in iphone
i am new to iphone..,i didnt use javascript until now
lak in iphone
A: 

Hmm I apparently can't comment so here's a more detailed explanation of Noddy Cha's answer.

To get values:

NSString * textBox1Value = [myWebView stringByEvaluatingJavaScriptFromString:@"document.getElementByid(\"tab1\").value"];

NSString * textBox2Value = [myWebView stringByEvaluatingJavaScriptFromString:@"document.getElementByid(\"tab2\").value"];

To set values:

NSString * ignoredString1 = [myWebView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.getElementByid(\"tab1\").value = \"%@\"", textBox1Value]];

NSString * ignoredString2 = [myWebView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.getElementByid(\"tab2\").value = \"%@\"", textBox2Value]];

Hope this helps.

Jason Jensen
A: 

i hav first copied the html tags into string and then updating the date whenever i want ...

and then finally iam displaying ths dynamic html on to the web view to verify it....

lak in iphone