Hi Matt,
As the other said I would suggest to have one button already selected unless
your business logic says not to suggest something to the user.
I think your generated Javascript doesn't check to see if at least one
button is selected. Can you post the JS code and the code for the submit
button?
>From the top of my head, you should have something like this in your
Javascript code:
<script language="Javascript" type="text/javascript">
function Validation() {
-----
if (document.FormName.outcome.value == "") {
alert("Please choose one outcome !")
document.FormName.outcome.focus()
return
}
-----
document.FormName.submit()
}
</script>
I'm not sure if you should check for "" or null.
HTH,
Cezar
-----Original Message-----
From: Matt E [mailto:[EMAIL PROTECTED]
Sent: Monday, August 25, 2003 12:31 PM
To: [EMAIL PROTECTED]
Subject: Validator JavaScript and html:radio buttons
Hi all. I have two radio buttons on a page, one both
named "outcome" one with the value of "Accepted" and
one with the value of "Rejected". In my
validation.xml file, I say that outcome is required.
The Javascript checking generated by the Validator
framework doesn't give an error if neither on is
selected, however the backend will, and produce an
error I can see with the <html:errors> tag.
How do I get the javascript to check the radio buttons
to make sure one is selected?
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]