opensubscriber
   Find in this group all groups
 
Unknown more information…

h : help-cgicc@gnu.org 9 January 2009 • 5:26PM -0500

[help-cgicc] how access to HTML controls atributes ?
by Vedro

REPLY TO AUTHOR
 
REPLY TO GROUP




Hi,

I am new to cgicc library and I have a following problem.
I defined <select> HTML control like this:

cgicc::select sel1 = cgicc::select();
sel1.set("name","someName").set("class","selectfield").set("SIZE","1");sel1.add(br());

sel1.add(option("0/1").set("class","selectfield").set("value","1"));sel1.add(br());

sel1.add(option("0/2").set("class","selectfield").set("value","2"));sel1.add(br());

sel1.add(option("0/3").set("class","selectfield").set("value","3"));sel1.add(br());

sel1.add(option("0/4").set("class","selectfield").set("value","4"));sel1.add(br());


I would like to access to every embedded object (each option) inside sel1 object going through some loop, check value of
each option object and set "selected" atribute if needed.

I see that  HTMLElement object has HTMLElementList data which contains embedded object but it is private and it's possible to add new object into this list only.
There is no interface which provide accessing  i.e. reading and seting different atribute inside particular object ( in this case in "options" object inside "select" object) and I do not understand why it's like that.

Are there any other ways to access (and changes) atributes inside defined objects ?

Thanks in advance

V.

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

opensubscriber is not affiliated with the authors of this message nor responsible for its content.