Forums

Validation problem

PicoPaco 10 Jun, 2010
I have a problem when validating forms. I seem to get a JS-error when I use the JavaScript Live validation. It doesn't work at all, and when I check the Errors on the site I see this message: "TypeError: Result of expression '$('ChronoContact_Upphandling').getInputByName2' [undefined] is not a function."

The form passes thru and doesn't care about the validation.
GreyHead 10 Jun, 2010
Hi PicoPaco,

Please check that all your form inputs have a 'name' attribute.

Can you post a link to the form please?

Bob
GreyHead 10 Jun, 2010
Hi PicoPaco,

It's a conflict with the JQuery in the template. The form without the template is OK (looks a mess but the validation works OK).

Bob
PicoPaco 10 Jun, 2010
Thanks again Bob!

Is there any way to use the server side validation code to change elements with jQurey? I tried to put:


<script type='text/javascript' language='javascript'>
$(document).ready(function(){
 $('#iso').html('Reqiered');
});
</script>


in the server side validation code area, but it didn't work. Any other suggestions. The only thing I want is that the border will turn red on the elements that is required, but not filled in.

Thanks
nml375 10 Jun, 2010
Hi PicoPaco,
You can use jQuery with MooTools (used by Joomla and ChronoForms) in no-conflict mode. Switching to no-conflict mode is as simple as adding a line of script after loading the jquery library:
jQuery.noConflict();


This will free the $ operator which is used by MooTools, so you'll have to update your own javascripts to use the longer jQuery operator.

There is also a neat system plugin named SC jQuery that allows you to control on which pages jQuery is loaded, and will always load it in no-conflict mode.

/Fredrik
PicoPaco 10 Jun, 2010
Thanks, got i working now!

I use "Show my own Divs" and I have put on a red border-color to the fields that are required. Is there any way to make it more clearly that there is some fields not filled in. If I use "default style" the page jumps up and the user see the red fields, but as it is now it just doesn't happened anything when the user click the submit button.
GreyHead 10 Jun, 2010
Hi PicoPaco,

I agree that the default messages are not very elegant:-(

With some work though you can do almost anything. Here are a couple of examples of customised error messages (both are ChronoForms with LiveValidation).

Bob
PicoPaco 11 Jun, 2010
Thanks for great support!

Do anyone know why the "required text" doesn't show in internet explorer (7).

My form
GreyHead 11 Jun, 2010
Hi PicoPaco,

I think it may be the line-height:0px setting

Bob
PicoPaco 11 Jun, 2010
You're right, thanks alot Bob!
ppeluse 11 Jun, 2010
I'm still getting the error when i try and validate my extension "We couldn't validate your key because of some wrong data used". Was talking to max via email but still waiting for his response. Thanks!
This topic is locked and no more replies can be posted.