• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jquery validation

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

Eric
 
Nandita Tiwari
Ranch Hand
Posts: 77
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup. NetBeans.

How should I go about it to resolve?
 
Nandita Tiwari
Ranch Hand
Posts: 77
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question 1: why is the button not of type submit?
 
Nandita Tiwari
Ranch Hand
Posts: 77
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Nandita Tiwari
Ranch Hand
Posts: 77
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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" />
 
Nandita Tiwari
Ranch Hand
Posts: 77
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it even possible to do?
 
reply
    Bookmark Topic Watch Topic
  • New Topic