CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: Update DIV when typing in input field

  1. #1
    Join Date
    Aug 2005

    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:


    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" });

    <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

  2. #2
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002

    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.

  3. #3
    Join Date
    Mar 2007

    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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)