Hi,
Something like this should do it (afraid I don't have any more free time to provide exact step by step instructions - so if you stuggle setting it up, lemme know - and I'll try and set it up for you at some point, but may have to charge)
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<%-- add this into your <head></head> section in user_signup.html --%>
<script>
function checkUserAvail(thisuser) {
document.getElementById('inline_check_avail').src = '<%config.db_cgi_url%>/page.cgi?p=user_avail_check;user=' + thisuser;
}
</script>
</head>
<body>
<%-- be sure to add the name="" bit into the form action, otherwise it won't be accessing the right bit of the form =))
<form
name="signup_form" action="<%config.db_cgi_url%>/user.cgi">
<%-- add the bit in bold to your signup_form.html template, in the Username field --%>
<input type="text" name="Username" size="20"
onkeyup="checkUserAvail(this.value);">
<%-- this is the important bit, as it will change from red to green, depending on if the user is available --%>
<p>
<iframe name="inline_check_avail" name="inline_check_avail" src="<%config.db_cgi_url%>/page.cgi?p=user_avail_check" width="113" height="43" scrolling="no" border="0" frameborder="0">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>
</p>
</form>
</body>
</html>
Then, make a new template called "user_avail_check.html" , with the following:
Code:
<%set isAvail = check_availability_username($user)%>
<html>
<%if isAvail%>
<body bgcolor="green">
<%else%>
<body bgcolor="red">
<%endif%>
</html>
Then, add a new global - called "check_availability_username", with the following code:
Code:
sub {
if (!$_[0]) { return 0; }
if ($DB->table('Users')->count( { Username => $_[0] } ) > 0) { return 0; } else { return 1; }
}
As I said, none of this is really tested (I quickly tested the HTML in Frontpage, but that doesn't guarantee it'll work =))
Hope that helps
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work! Want to give me something back for my help? Please see my
Amazon Wish List GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500) Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin |
Pre-Made Template Sets |
FREE GLinks Plugins! Compare our different Plugin packages *new* Free CSS Templates