Skip to main content
Known Participant
February 14, 2009
Question

HELP! username server side validation

  • February 14, 2009
  • 2 replies
  • 913 views
hey all. Could someone possibly help me with this case. Been googling for a week already and no luck so far... What i'm trying to do is to check if username already exists in my mysql database, but not on form submission, but onblur. as a perfect example of my vision : http://www.shawngo.com/gafyd/index.html
I know it's possible to achieve but ... so please, any help would be appreciated.
This topic has been closed for replies.

2 replies

Inspiring
February 14, 2009
If you are version 7 and lower, ajax won't be available. That being the case, you could do something with iframes and inner html.
Simon.DauAuthor
Known Participant
February 14, 2009
I'm using cf8. Right, so I've checked those links and correct me if i'm wrong, but I need to create coldfusion component which would check username with database and would return positive or negative value. To pass value to component I would need javascript functions which will be triggered by onblur event. To pass value of textfield to component i'll need to use address link ("check_username.cfc?username="text field value"). If i'm right and that's the way to do it, please please please help me out with functions cause I don't know java at all (+failed the exam which still hurts a lot).

thanks in advance (and for responses)

Simon.DauAuthor
Known Participant
February 15, 2009
nevermind lads, sorted myself. feeling really proud now :) if only I would know how to change color of text depending on response. Any thought? the answer comes to this: <span id="responseArea"></span> and function that outputs it is called displayResponse.
ajithman
Inspiring
February 14, 2009
Hi,
It is possible by using the inbuilt Coldfusion 8 AJAX tag <cfajaxproxy>

Call the javascript function in the onblur event that checks whether the username exists in your database. Based on your result update your HTML to show the appropriate result. Check this tutorial link:-

http://tutorial13.learncf.com/
OR
http://ajithmanmadhan.wordpress.com/2009/02/14/very-simple-coldfusion-javascript-chat/