Form validation

Form validation

by Jay Fleetwood -
Number of replies: 3

Hi, I'm having trouble with validating a custom registration form. The form works as intended and is well integrated into Moodle's db, but I can't get any javascript validators to work (the latest one I've tried wants to submit the form before validating).

Is there any way to use Moodle's built-in validation scripts to use on my form? I know that it validates fields on its built-in signup page but I can't figure out where that could be located.

Thanks in advance!

Average of ratings: -
In reply to Jay Fleetwood

Re: Form validation

by Dorel Manolescu -
Picture of Plugin developers

Hi

I think it will be useful to know if:

1) you build your form with Moodle standard forms ( formslib )

2) you want o make the validation on client side ( empty fields, valid email ...) or on server side ( check against database ) .

Let us know! Thank you!

In reply to Dorel Manolescu

Re: Form validation

by Jay Fleetwood -

Hi manolescu, 

Actually, I decided not to use moodle's built-in forms after all. I instead created my own form and used Javascript to validate it along with PHP for the username. It works fine now.

Thanks anyway

In reply to Dorel Manolescu

Re: Form validation

by Uthayaseelan Sitharthan -

Hi,

 I need to add custom email validation client side (using jquery).

How can I implement this and what are the steps need to be followed?

As I am beginner , please help me to walk through moodle basics.

Thanks,

Uthaya.