markmuir Posted August 22, 2006 Share Posted August 22, 2006 Hi, in serious need of help.I have a registration form that adds users to a MySQL database. What i'm wanting to do is:>When you enter the users membership number and then attempt to go to the next field, I want to connect to a MySQL database and check to see if the membership number has been entered and if so, display a pop up box telling me so instead of waiting to type all the information and when I press enter, it tells me then as it can be so time consuming. Can this be done??Any help at all would be greatly appreciatedThanks Quote Link to comment https://forums.phpfreaks.com/topic/18283-validation-check-from-mysql-database/ Share on other sites More sharing options...
ronverdonk Posted August 22, 2006 Share Posted August 22, 2006 I guess you need some JavaScript routine to dynamically capture and process that input for member number. Quote Link to comment https://forums.phpfreaks.com/topic/18283-validation-check-from-mysql-database/#findComment-78514 Share on other sites More sharing options...
HuggieBear Posted August 22, 2006 Share Posted August 22, 2006 [quote]I guess you need some JavaScript[/quote]I you could use onBlur() to sumbit the form. Here's an example of onBlur() in action: [url=http://www.webreference.com/js/tips/000804.html]http://www.webreference.com/js/tips/000804.html[/url]RegardsRich Quote Link to comment https://forums.phpfreaks.com/topic/18283-validation-check-from-mysql-database/#findComment-78515 Share on other sites More sharing options...
markmuir Posted August 22, 2006 Author Share Posted August 22, 2006 The onBlur function looks as though it could work but is it possible to enter MySql commands within the function?? Or is there any other way I can get it to connect to a mysql database to check to see if the membership number has already been entered after the user has clicked out of the input box? Quote Link to comment https://forums.phpfreaks.com/topic/18283-validation-check-from-mysql-database/#findComment-78521 Share on other sites More sharing options...
HuggieBear Posted August 22, 2006 Share Posted August 22, 2006 Rather that try and stick sql code into a javascript function you're probably better getting the onBlur() event to just submit the form at the early stage and use the php code that it's calling to verify the data/query the database.It's likely to be easier that way around.RegardsRich Quote Link to comment https://forums.phpfreaks.com/topic/18283-validation-check-from-mysql-database/#findComment-78522 Share on other sites More sharing options...
markmuir Posted August 22, 2006 Author Share Posted August 22, 2006 Could you tell me how this is done please?? Still in the process of learningThanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/18283-validation-check-from-mysql-database/#findComment-78524 Share on other sites More sharing options...
ToonMariner Posted August 22, 2006 Share Posted August 22, 2006 You need AJAX.[url=http://www.w3schools.com/ajax/default.asp]http://www.w3schools.com/ajax/default.asp[/url]after reading that it took me about 30 mins to bang some decent AJAX together. That is what you need my friend. just change the traget urls to the php scripts you wish to use. Quote Link to comment https://forums.phpfreaks.com/topic/18283-validation-check-from-mysql-database/#findComment-78533 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.