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 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jquery validation" Watch "jquery validation" New topic
Author

jquery validation

Noopur Kore
Ranch Hand

Joined: Aug 18, 2012
Posts: 77

I am trying to validate my form using mootools.
I imported all the libraries required and wrote javascript. According to a online tutorial I saw that I needed to change attributes of my input tag.
Here's how I did it.



This is my input tag -- <input type="text" name="fname" class="validate['required']"/> --- this is showing an error that "required" is an unexpected symbol..
This is my submit button -- <input type="submit" value="Submit" class="button submit">

How should I go about it??? Please help.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
What is showing that error? Your IDE? That library really should use html5 data attributes instead of classes.

Eric
Noopur Kore
Ranch Hand

Joined: Aug 18, 2012
Posts: 77

Yup. NetBeans.

How should I go about it to resolve?
Noopur Kore
Ranch Hand

Joined: Aug 18, 2012
Posts: 77

I gave up on mootools and using jquery, which works fine. I still have a doubt, the validation library I'm using just works on <input type="submit">, how can i work it out on type=button
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

Question 1: why is the button not of type submit?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Noopur Kore
Ranch Hand

Joined: Aug 18, 2012
Posts: 77

It's a two div form. One div generates a table and this table is then sent to database using submit button. I want to do validation during the table generation.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

What does table generation have to do with button clicks? Making us guess isn't going to help you get answers.
Noopur Kore
Ranch Hand

Joined: Aug 18, 2012
Posts: 77

I have two buttons on my 1st div which generates the table.
<input type="Button" value="Confirm" onclick="insRow()"/>
<input type="Button" value="Preview" onclick="openWin()"/>

I want the validation done on preview button. while the confirm button send the data generated by preview button to another div.
This data accumulates in 2nd div. And is then submitted to servlet on submit.
<input type="Submit" value="Submit" />
Noopur Kore
Ranch Hand

Joined: Aug 18, 2012
Posts: 77

Is it even possible to do?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jquery validation