ChronoEngine Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Using JavaScript validation (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 3
TOPIC: Re:Using JavaScript validation
#8509
a6april (User)
Junior Boarder
Posts: 21
graphgraph
User Offline Click here to see the profile of this user
Re:Using JavaScript validation 2 Months ago Karma: 0  
How do I add more fields to this code???
Code:

function checkForm(form) { if(form.Name.value == "") { alert("Please Enter Your Name!"); return false; } return true; }
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/17 05:45 By GreyHead.
  The administrator has disabled public write access.
#8518
GreyHead (Admin)
Support
Admin
Posts: 2905
graph
User Offline Click here to see the profile of this user
Gender: Male bobjanes Location: Brittany
Re:html tidy 2 Months ago Karma: 62  
Hi sailsmart,

I'm not completely sure what you are asking here.

In form validation we are usually talking about using some JavaScript or PHP to check that the form user has made the right kind of entry in a form field (for example, an email address is actually an email address and not a nonsense string).

You can use HTML Tidy to check that your form code is using valid HTML - that's also useful, you can run the page url through one of the on-line validators. I'd recommend that you use FireFox with the FireBug extension which is by far and away the best web-page debugger. (There's also an HTML validator extension for FireFox.)

Bob
 
Report to moderator   Logged Logged  
 
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
#8519
GreyHead (Admin)
Support
Admin
Posts: 2905
graph
User Offline Click here to see the profile of this user
Gender: Male bobjanes Location: Brittany
Re:Using JavaScript validation 2 Months ago Karma: 62  
Hi a6april,

Don't. If you are looking for simple 'required' field validation then use the Validation built in to ChronoForms. Go to the Validation tab turn it ON, set the library to Mootools for Joomla 1.5 (or leave as prototype for Joomla 1.0.x) and put a comma separated list fo field names in the 'required' box.

No more messing with special scripts.

Bob
 
Report to moderator   Logged Logged  
 
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
#8523
a6april (User)
Junior Boarder
Posts: 21
graphgraph
User Offline Click here to see the profile of this user
Re:Using JavaScript validation 2 Months ago Karma: 0  
Thanks Bob,

I had no idea that Validator even worked, I did not know to put it on Mootools, wow that just saved me about 3 or 4 headaches.

I do have a question on how to add the email validation. I scrolled down to the
7- validate-email (a valid email address)

I then put the email field in there, however when I test the form, the email does not get validated and the form gets sent right on through with the email field blank. (I did double check for form field case mis-match.

Also where is the css to change the color of the text that pops up and says required?, can I change that text?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#8524
GreyHead (Admin)
Support
Admin
Posts: 2905
graph
User Offline Click here to see the profile of this user
Gender: Male bobjanes Location: Brittany
Re:Using JavaScript validation 2 Months ago Karma: 62  
Hi a6april,

You probably need to put the 'email' field in 'required' too. The 'validate-email' field (and the others) work on the basis of 'if there is an entry is it a valid entry' so blank entries are OK. That makes sense when you think about.

The validation works with css classes. Error messages show up with class="validation-advice" so just add some css for that.

Bob
 
Report to moderator   Logged Logged  
 
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
#8526
a6april (User)
Junior Boarder
Posts: 21
graphgraph
User Offline Click here to see the profile of this user
Re:Using JavaScript validation 2 Months ago Karma: 0  
Are you saying on line 139 of the validation.js file

Code:

advice = '<div class="validation-advice" id="advice-' + name + '-' + Validation.getElmID(elm) +'" style="display:none">' + errorMsg + '</div>'
I need to edit this, i do not see any css attached to it unless I have to figure out how to say add a color to the code above or is there a css file somewhere I can't find?
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/17 13:53 By GreyHead.
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop


equalheight If you have any questions you can post to our forums and we will be glad to help ASAP

Members Login






Lost Password?
No account yet? Register

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for
goods and services provided by ChronoEngine.com

ChronoForms License

equalheightTo be able to continue working at this component we decided to get a small profit out of it but at the same time don't force everybody to pay in order to use this great component.

 

 From version 1.5 and up a link at the bottom of everyform created will be placed, saying "joomla professional work", the link will be to us here htttp://www.chronoengine.com, its illegal to remove this link from the source code unless you have a license,

so the license is very simply for the same ChronoForms component without a link, thats all!

This License is for 5 different websites ONLY. 

 

 However, in order to allow everybody to still use the component and even get out of this, the link is inside a div with class : chronoform , use this to hide the link by using different colors or whatever if you really can't pay, but of course the link is still exists at your page source.

 

The license is ONLY 25$ can be bought here :

 

Thank you!

 

ChronoEngine.com Team 

Joomla Templates and Joomla Tutorials