Re: [QuickForm] Using JavaScript with QF generated Fields ?
| From: | Alexey Borzov | Date: | Wed, 08 Dec 2004 19:29:12 +0000 |
| Subject: | Re: [QuickForm] Using JavaScript with QF generated Fields ? | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16121@lists.php.net to get a copy of this message | ||
Hi,
Justin Patrin wrote:
The right approach would be of course to set the IDs manually in which case they are not autogenerated and are known to the script's author...Did you see the word "javascript" in the name of this mailing list? No? That's because there isn't one!No need to have been so harsh...you could have just responded to his implied question. That would be: "Are the ids set randomly? Is there any way to know what they're going to be?" This *does* have to do with QF as the ids are set by QF.
The correct way is using DOM method getElementById() (or maybe getElementsByName()), 'name' attribute of <form> tag is not valid XHTML.You may want to use the "correct" way of accessing the form. First of all, give the form a name if you haven't already. Second,"The object does not support that action" I can't figure out if that is because of an error in the Jscript or some Problem according to QF.
document.forms["formName"].elements["elementName"].checked = true;