/    Sign up×
Community /Pin to ProfileBookmark

JavaScript && DB

Hello,
I want to verify that the data in my form in HTML is already exist in my database if this is true then the form must not be sent.
I know this is done in javascript but I can not found the right solution.
I would like an illustrative example ,please.
Thanks.

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@cbVisionNov 23.2011 — It can't be done with JavaScript alone. You need to use a server side language to interact with the database (ex: PHP).

You can use JavaScript (AJAX) to make a call to the PHP file that checks the database and then prevent the form from being submitted.
Copy linkTweet thisAlerts:
@KorNov 23.2011 — And :

I would like an illustrative example ,please.
[/QUOTE]

http://www.w3schools.com/php/php_ajax_database.asp
Copy linkTweet thisAlerts:
@djowelleauthorNov 23.2011 — Thank you ,this is the example that I want ?
Copy linkTweet thisAlerts:
@djowelleauthorNov 23.2011 — I could not be able to add an php file to my webapplication project.

How can I create a php file with netbeans 7?
Copy linkTweet thisAlerts:
@KorNov 24.2011 — I could not be able to add an php file to my webapplication project.

How can I create a php file with netbeans 7?[/QUOTE]

You may create it even with Notepad... ?. Make sure you save your file as UTF-8 encoded, without BOM.

But:

Are you working on a server? You need a server, like Apache, to be installed and started.
Copy linkTweet thisAlerts:
@djowelleauthorNov 26.2011 — Thank you for your help ?
×

Success!

Help @djowelle 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.18,
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,
)...