-1

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......

Linux world
  • 3,750
  • 11
  • 44
  • 59

3 Answers3

1

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
  • 851
  • 1
  • 12
  • 19
1

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 O. Jensen
  • 301
  • 2
  • 6
-1

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....

Linux world
  • 3,750
  • 11
  • 44
  • 59