...

View Full Version : ajax username



Zangeel
08-12-2008, 04:44 AM
Hello, i have a script, and to sign up for it, you put a username, and all the other info, but i want a little ajax modification on it so next to the username box it will show what their profile url will look like

Username : [ USERNAME INPUT BOX ] http://www.mysite.com/{what they typed}

anyone know of any premade scripts that can do this

ninnypants
08-12-2008, 04:59 AM
This will do it you don't need ajax


<script type="text/javascript">
var url = "http://www.mysite.com/";
function updateURL(folder){
document.getElementById('preview').innerHTML = url+folder.value;
}
</script>
<input type="text" onchange="updateURL(this)">
<div id="preview"></div>

binaryWeapon
08-12-2008, 05:51 AM
You could also do it on keyup:


<script type="text/javascript">
var url = "http://www.mysite.com/";
function updateURL(folder){
document.getElementById('preview').innerHTML = url+folder.value;
}
</script>
<input type="text" onkeyup="updateURL(this)">
<div id="preview">http://www.mysite.com/</div>

ninnypants
08-12-2008, 06:07 AM
now that I think about it he probably needs AJAX to check for repeat user names.

@zangeel what is your server side language?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum