• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: username check realtime

username check realtime 4 years 5 months ago #40716

  • booija
  • booija's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
I want to be able to indicate in a field where one can enter a username immediately after leaving the field whether the chosen username already exists or not yet.

I have already found the code below for this.

$database = JFactory::getDBO();
$user = ''; //This is where the value of the username field should be
$database->setQuery("SELECT username FROM #__users WHERE username='".$user."'");
$database->query();
if (intval($database->loadResult()) >= 1)
{
echo 'Your chosen username already exists on this website';
}

But how do I get this code to run after exiting the field.
And a message is given whether the chosen username already exists or not yet.
The administrator has disabled public write access.

username check realtime 4 years 5 months ago #40717

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 745
  • Thank you received: 66
Hello,

What you are describing requires an AJAX custom script that will be triggered when the focus is moved to a different field. The script should check for the username availability using a code similar to the one you have provided and return a message informing the submitting user if the username is available or not.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

username check realtime 4 years 5 months ago #40725

  • booija
  • booija's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
andreic wrote:
Hello,

What you are describing requires an AJAX custom script that will be triggered when the focus is moved to a different field. The script should check for the username availability using a code similar to the one you have provided and return a message informing the submitting user if the username is available or not.

Okay
But how can I make this?
Or is it also possible as a validation.

I have searched a lot but couldn't find anything.

A validation is also an option.

Can you help me.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!