• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jquery validation

 
Noopur Kore
Ranch Hand
Posts: 77
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is showing that error? Your IDE? That library really should use html5 data attributes instead of classes.

Eric
 
Noopur Kore
Ranch Hand
Posts: 77
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup. NetBeans.

How should I go about it to resolve?
 
Noopur Kore
Ranch Hand
Posts: 77
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question 1: why is the button not of type submit?
 
Noopur Kore
Ranch Hand
Posts: 77
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 77
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 77
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it even possible to do?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic