close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

MySQLi Check New Username and Server Validations on same page? Not possible?

Thread began 2/02/2017 8:26 pm by Nathon Jones Web Design | Last modified 2/03/2017 4:29 pm by Ray Borduin | 182 views | 6 replies |

Nathon Jones Web Design

MySQLi Check New Username and Server Validations on same page? Not possible?

I have a simple registration form on a page that asks for just a username (email) and password. I want to use the MySQLi Check New Username behaviour on this page to check against the username in case it's already registered.

However, I also want to run a server validation on the password field so that it contains between 8-16 characters and also so that it doesn't include spaces or certain characters.

Can I get this to work? Nope.

I can't set an action on the form because that cancels out the Check New Username behaviour. I can't set a "success" redirect page with the Check New Username behaviour, only a failure page. I have to direct to a separate page in order to get Server Validation to work.

My head hurts. What is the proper order in which I should do this?

Thank you.
NJ

Sign in to reply to this post

Ray BorduinWebAssist

You shouldn't need an action on the form. You can do both check username and server validation and the insert record on the current page. The only success redirect you need is the redirect after the insert takes place.

Set the failure redirect of the check username to the current page with a url parameter attached and then check for that url parameter to show a message that it failed.

Sign in to reply to this post

Nathon Jones Web Design

That's what I have in place. It doesn't work.

If the Check New Username fails, a message is displayed because I have a url parameter attached to the failure redirect. However, if I try another username, that I know doesn't already exist, but the Server Validation fails this time, the Check New Username error message is still displayed.

I've even tried adding the same url parameter to the failure redirect of the Server Validation, but with a different value, but it just appends to the URL so that both parameters are true!

Urggh. What am I doing wrong (again!)? :( See attached and link below.

Sign in to reply to this post

Ray BorduinWebAssist

add a form action="dreamcaruk-register.php"

That will reset any url parameters after the form submits.

Sign in to reply to this post

Nathon Jones Web Design

Originally Said By: Ray Borduin
  You shouldn't need an action on the form.  



?

Sign in to reply to this post

Ray BorduinWebAssist

By default you don't need an action because it will default to the current page including all parameters. However want the url parameters cleared, so in your case you will want to add one.

Sign in to reply to this post

Nathon Jones Web Design

Sorry Ray, I was following your advice to the word. That's resolved it now.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...