struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mitch Claborn" <mi...@claborn.net>
Subject RE: Client side validation for radio button
Date Fri, 12 Oct 2007 12:23:08 GMT
In this case it is the xhtml theme.  (Isn't specified in the <s:head tag but
using the default specified in struts.properties.)

  _____  

Mitch Claborn
mitch@claborn.net



-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Wednesday, October 11, 2000 5:52 PM
To: Struts Users Mailing List
Subject: Re: Client side validation for radio button


in your jsp head tag..
    <s:head theme="?"/>
what value have you assigned to theme?

M-
----- Original Message -----
From: "Mitch Claborn" <mitch@claborn.net>
To: "'Struts Users Mailing List'" <user@struts.apache.org>
Sent: Thursday, October 11, 2007 5:38 PM
Subject: Client side validation for radio button


Using the xhtml theme, client-side validation for radio button is not
working.  I've tried both "required" and "requiredstring" but I suspect that
none will work.  The javascript code (from form-close-validation.ftl) does
this:


    function validateForm_Question() {
        form = document.getElementById("Question");

        if (form.elements['q1']) {
            field = form.elements['q1'];
            var error = "Please answer q1";
            if (field.value == "") {
                addError(field, error);
                errors = true;
            }
        }

Which doesn't get the actual value of the selected radio.  I can code a
workaround in form-close-validation.ftl but it seems like this would have
been solved already?




Mitch Claborn
mitch@claborn.net



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message