1) devxonGroup: Members Posts: 3Joined: 1 Jan 2005Location: VenezuelaIP: 146.23.--.--
Posted:
Hello everybody! It was a long time since I wrote here. :)
Well, I am concern about how to get the checked items from the CheckTree component. I am a noob javascript developer.
The way I am trying to get these checked is assigning an ID to every single checkbox and then loop through them. I don't know whether there is a better way to do it, sure there will be!
Hearing comments... Thanks in advance.
Fernando Peluffo
2) devxonGroup: Members Posts: 3Joined: 1 Jan 2005Location: VenezuelaIP: 146.23.--.--
Posted:
Ok guys.
I workaround my problem using this code:
function getValues(){ var code var sCCNs = ""
chkGroup = document.forms[0].chkATs
for (i=0; i < chkGroup.length ; ++ i){ if (chkGroup[i].checked){ code = chkGroup[i].id.split("-",3) sCCNs += code[1] + ";" sCCNs += code[2] + "|" } }
I just needed one nested level that's why I used the ";" and the "|" symbols to later split the string returned using server side script.
If someone know how to do this using regular expression (if it's possible), let me know so I can learn more.
P.D: Angus, great job man! I am learning from your code eventhough it seems a bit abstract to me as javascript is not my strong skill. xD
Fernando Peluffo
3) Angus TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 222.154.--.--
Posted:
Good to hear that you're having fun :).
Yes, any standard JS form-processing code will do. Put an ID on all elements and you might find the document.getElementsByTagName('input') function handy to retrieve a list of all INPUT elements then check their TYPE.