/    Sign up×
Community /Pin to ProfileBookmark

validate user input before submit

Hello,

I am trying to validate and input field for userid. I want the field to be validate after the user leave the field and Before submitting it.

so basically, I want to grap the user input and do a sql select to see if the userid is already exist.

is there any way for doing this w/o using ajax?
or is there a way that after the form is submit, I can redirect the user back to the same page with all the data still there?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@WolfShadeMar 26.2012 — AJaX would be your best bet. But, yes, if you use session variables you can redirect back to the page and throw an alert. But I think you need to use output buffering, unless you use a META tag for the redirect - header() will not work without output buffering.
×

Success!

Help @byebyebyezzz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...