You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mitch Claborn <mi...@claborn.net> on 2007/10/12 14:23:08 UTC

RE: Client side validation for radio button

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" <mi...@claborn.net>
To: "'Struts Users Mailing List'" <us...@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