-
March 6th, 2007, 04:28 AM
#1
Update DIV when typing in input field
I have an input field, and when I type in it, I want a div to be updated at the same time.
I have a script that works this way, but I've just copied it, and it uses very much code. So I want a very simple one to work. Here's what I've got so far:
JavaScript:
Code:
function goCheck() {
var u_name = document.getElementById('username').value;
if (u_name!="") {
document.getElementById('output').innerHTML = "<h3>Please Wait, getting results....</h3>";
var url = 'test1.php';
var pars = 'output=normal&username='+u_name+'';
var myAjax = new Ajax.Updater( 'output', url, { method: 'get', parameters: pars, onlyLatestOfClass:"htmlfetcher" });
}
}
HTML:
Code:
<input type="text" id="username" size="25" onkeyup="goCheck();">
<span id="output"><h3><font color="#D55121" face="arial">The usename will be here</font></h3></span>
What should I do to make this work?
Thanks in advance
-
March 6th, 2007, 08:32 AM
#2
Re: Update DIV when typing in input field
Take a look at this. It explains it much simpler.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
April 9th, 2007, 12:28 PM
#3
Re: Update DIV when typing in input field
Where are the class "Ajax.Updater"??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|