File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes jQuery validation and radio buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jQuery validation and radio buttons" Watch "jQuery validation and radio buttons" New topic
Author

jQuery validation and radio buttons

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9499
    
    2

Just stumbled upon another one: This time with the radio buton. The rendered HTML is as follows:



I can clearly see that the problem is because of the fact that both has the same name. But I can't help it as the server side code would like below;



Now this really needs a work around.



SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9499
    
    2

Here is the rendered screenshot and by the way this validator plugin is really cool.



[Thumbnail for HtmlOutput.png]

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9499
    
    2

Oopss.... I guess I enough polluted the other topic. Good that you spun this off into a new one.

All right, do you have some clues for me on this one?
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9499
    
    2

Made some progress. But now the error message is not displayed at all.



I also have added the following to my css:


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61603
    
  67

Radio buttons must have the same name to be part of the same radio group.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9499
    
    2

OK. Got rid of the problem:

My Struts tag looks like:



My validate method for jQuery looks like:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jQuery validation and radio buttons