Buy Now
Sign in

js check if username/email is used

alfredopacino , November 27 2013, 23:31
A
alfredopacino 111
November 27 2013, 23:31 #320238
hi as in title, there's a method to check in ajax if username or email is already used?
GreyHead 64
November 28 2013, 09:32 #320253
Hi alfredacino,

You can do it using AJAX in the form or with Custom Serverside validation after the form is submitted.

There's an AJAX example in this paid tutorial.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
A
alfredopacino 111
November 28 2013, 18:53 #320278
thanks, and if i would just show onsubmit the various errors (server side) that the user could do?
I mean the errors the debugger print, how can i set this visible to the user?
user name already taken, wrong email form, password verify don't matched, uploaded file size exceeds the allowed limit...
GreyHead 64
November 28 2013, 20:34 #320282
Hi alfredpacino,

You can use the Custom Serverside Validation action in ChronoForms to run your own tests and show your messages.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
A
alfredopacino 111
November 29 2013, 15:02 #320299
i know
but these arent'my custom validation.. i mean the default server validations already in.
i didn't set any username server validation (or email form), but i see in debugger
Validation Errors: 
Array
(
[0] => Nome utente utilizzato
)
Debug Data
Couldn't save new user, Joomla returned this error : Nome utente utilizzato


i want to set these messages visible to the all users, without debugger.
GreyHead 64
November 29 2013, 15:35 #320301
Hi alfredacino,

Please add an Event Loop action to the pink On Fail event of the Joomla! Registration action.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
A
alfredopacino 111
November 29 2013, 21:06 #320312
i really appreciate your support, man.

some sample easy forms (joomla registration, file upload, a simple custom js validation) would help many users for these issue and save your time and forum db space
all those actions are not so easy to understand: where they have to placed and what they do exactly
GreyHead 64
November 29 2013, 22:21 #320318
Hi alfredacino,

Most of those are covered in FAQs, some with videos. There's a PDF Tutorial for Joomla! Registration which includes the Event Loop step. (Though I see the link from the FAQ is broken since the site upgrade :-(

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
V
vivora66 12
May 01 2014, 06:42 #329629
Hi I just purchased your paid tutor, but it is not working, maybe because I'm doing something bad, sorry I'm mew here.

I'm using the advanced wizard and I put the "Load JS" with the code of your tutor in the event "ON LOAD" and I created the event "ajax"with the PHP database query on that event.

Now I double checked the variables, the database connection, etc etc but the sample is not working, nd nothing happen, please maybe yu can clarify the thing

Tank you
GreyHead 64
May 01 2014, 08:48 #329634
Hi vivora66,

Please post a link to the form so I can take a quick look.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
V
vivora66 12
May 08 2014, 15:38 #330045
Something is wrong with the returning function
           onComplete: function(r) {
// check the result and set the background color
if ( r == 'ok' ) {
pepinous.setStyle('background-color', 'green');
} else {
pepinous.setStyle('background-color', 'red');
}
}


Allways, scritp after the AJAX PHO functions goes to r<>'ok' displaying my from in red
V
vivora66 12
May 08 2014, 16:07 #330048
hi this is the link
http://www.boliviabox.com/index.php?option=com_chronoforms&tmpl=component&chronoform=suscripcion_usuario

In checking the "Nombre de Usuario" field to chek in my DB id the user is "IN USE", just works checking the length of characters, puting yellow when it is lower than 6 chars, whein it is over 6 goes to the AJAX function but always it is returning "IN USE" because the color of the form is in RED ALWAYS, is like the function always check the DB returns a "IN USE" value
Please letme know how I can show the return value to be sure maybe in the upper part of field
V
vivora66 12
May 09 2014, 05:46 #330075
your tutor work well, changing the colors of field, but how i can also display a message like "email in use" and how i could nos process the form when pressing submit, i mean do not process anything until the r = 'ok'
please helpme

thank you