views:

469

answers:

2

I am trying to use FormCheck for MooTools to validate a basic contact form I am planning to build. The problem is I can't seem to set up the script to work at all =(

If anyone knows about FormCheck or MooTools and can add any pointers they would all be greatly recieved.

My page: http://is.gd/1p1Ys

Thanks

Ryan

+1  A: 

If you are using jQuery you may want to check out various jQuery plugins that will do form validation for you. The validation plugin works pretty well. If you want to use jQuery and MooTools together, you probably need to make sure that you are using jQuery in noConflict mode.

tvanfosson
+1  A: 

You are using jquery AND mootools on the same page? Why would you do that, it's a bad practice and bad form to stuff your users for two frameworks for what is a small page without anything complex. that aside, are you using the noconflict mode in either framework (note that this is only available since mootools 1.2.3 and requires some changes in the source code of the plugins, probably better off namespacing jquery)

first of all, you have a mootools domready function then you do inline js on the body tag onLoad...

then at the bottom of the source, you try the mootools domready again...

then you embed an accordion script (something that mootools can have built in as part of mootools-more). not sure what you use jquery for but you really need to structure your page better and pick a single framework.

the error you are getting in the formcheck js implies that either this.form is undefined (at time of evaluation $("contactform") was not available or that this.form.getElements() is not a valid method, which would imply that the mootools element prototype is not working. once again, are you using the noconflict mode?

it really needs refactoring and rethinking...

Dimitar Christoff