954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Validate if user input already exists in MYSQL database.

Hi,

I'm not familiar with the AJAX way of doing this, hence why I'm posting this.

I've got this form that needs to check if the user input is already in the database, if this isn't the case it should disable the submit button and display an error depending on which input isn't found.

eg. client name isn't found...

This is the form:

<form autocomplete="off" action="formaction.php" method="post">
<fieldset>
<legend>Vul Zending</legend>
<p><label for="zending">Zending: </label> <select id="Zending" name="zendingID"><?php echo $zending_block; ?></select></p>
<p><div><label for="klant">Klant: </label> <input name="klant" type="text" size="30" value="" id="inputString" onkeyup="lookup(this.value);" onblur="fill();" /> <input type="button" value="..."></div><div class="suggestionsBox" id="suggestions" style="display: none;"><img src="image/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" /><div class="suggestionList" id="autoSuggestionsList">&nbsp;</div></div></p>
<p><label for="number">Aantal: </label> <input type="number" name="aantal" size="2" /></p>
<p><label for="manden">Manden: </label> <select name="mandenID"><?php echo $manden_block; ?></select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" value="Add" name"checkbox" checked="checked">    <b>Compleet?</b></p>
<p><label for"bestemmeling">Bestemmeling: </label> <div><input name="Best" type="text" size="30" value="" id="inputString2" onkeyup="lookup2(this.value);" onblur="fill2();" />&nbsp;&nbsp;<input type="button" value="..."></div><div class="suggestionsBox2" id="suggestions2" style="display: none;"><img src="image/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" /><div class="suggestionList2" id="autoSuggestionsList2">&nbsp;</div></div></p>
<p class="submit"><input type="submit" value="Voeg Toe"></p>
</fieldset>
</form>


How do I get this to work?

Kind Regards,

Stefan

Stickie
Light Poster
28 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
 
fobos
Posting Whiz in Training
297 posts since Feb 2009
Reputation Points: 29
Solved Threads: 52
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: