Forums

validate error wipes out form

cjmicro 24 Aug, 2008
Hi, I have the validation for fields set with the moovalidation, and that works well. If the field is not validated, it flashes red and reminds them.

However, the system (community builder, but I imagine the joomla registration is similar) checks for a unique username. If the person chooses one that is invalid (in use), when you hit submit, it returns an error window (not on the form) and goes back to the form. BUT then all the fields are empty, and you have to start again.

Is there a way to keep it from wiping out the form with this validate error so they can just pick another username? The form is long and it's really frustrating to have to go start over!!

Thanks for any assistance,

Cheryl
GreyHead 24 Aug, 2008
Hi Cheryl,

I'm not sure how the form returns after this kind of error. Typically you'd make sure that the values on your form are set from the $_POST array (so they are blank only if the array is empty). Using this with the ChronoForms showform($_POST) function can work well to preserve form data - but is a hassle to implement except for text and textarea tags.

Beta 3.0 has this functonality built-in I believe. But it's not easy to upgrade your forms from 2.5.

Bob
Max_admin 24 Aug, 2008
Hi Bob, this is a built in function in the Joomla user check and its used in the registration plugin.

Hi Cheryl,

as Bob said this feature is built in V3.0 however, in this case specially, I'm not sure if Joomla will return the submitted data array or not, I think the best solution here is to check the submitted data using the form before executing the plugin and return back with showform function assuming you got V3
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
cjmicro 24 Aug, 2008
I do not have v3, since it was beta, I was waiting for stable.

Does v3 show the form for "verification" before submitting? That was a function we wanted, but didn't Bob say it's hard to convert forms over? Not sure what to do, if I should upgrade or not.

In the meantime, how would I , as you suggested,

check the submitted data using the form before executing the plugin.

Sorry to be dense, I am not a programmer (i expect you have all figured that one out a long time ago!!)

Cheryl
Max_admin 24 Aug, 2008
Hi Cheryl,

If you want to verify the form by showing it again before final submission, this is easy with V3 server side validation, you can pass some false input first time and change it later!

#2- to check submitted data, you can again use the server side validation in V3, try to look the users table for the username, and if it returned any results the validation will fail and the user will see the form again with all fields loaded and you are able to write any error message you want at the top.

V3 has too many new features but some users report few issues, its worth upgrading but if you can wait for a stable one then wait, to upgrade you will need to redo all your forms, maybe I will make some converter later but I think this will not be the best one because many things are changed!

I think you had some problems between V3 and CB plugin ? I have fixed those and posted the fixed versions at some post here few days ago!

cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
cjmicro 24 Aug, 2008
Ok, but I'm not using v3, so I guess I will have to wait.

I'm just going to tell people to LOOK at their info and make sure it's correct before submitting. Problem solved.

Cheryl
GreyHead 24 Aug, 2008
Hi Cheryl,

I get round the username problem in a couple of cases by setting the username and password for the client. For usernames I used the lastname+firstname+hashcode e.g. testuser863. That can work for some clients. If people really want to set their own usernames then you could put a little bit of validation code in to check it before the Joomal validation is set in motion - but I think this might mean hacking the PlugIn.

Bob
cjmicro 24 Aug, 2008
Thanks Bob, I really appreciate all the support here. So far your forum is one of the best for support responses and I posted my glowing review on joomla extensions!

Cheryl
This topic is locked and no more replies can be posted.