AJAX and javascript form validation
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: AJAX and javascript form validation

  1. #1
    Join Date
    Jul 2010
    Posts
    1

    AJAX and javascript form validation

    Hi there,

    I currently have a problem with validating a form. The form is created by AJAX:

    Code:
    xmlhttp.onreadystatechange=function(){
    				if (xmlhttp.readyState==4 && xmlhttp.status==200){
    					document.getElementById("editUserContent").innerHTML=xmlhttp.responseText;
    				}
    			}
    				xmlhttp.open("GET","getuser.php?q="+str,true);
    				xmlhttp.send();
    			}
    getuser.php creates the form and echo's it back to the original page. On submitting of the form it uses javascript to check for errors or missing information. However the javascript is on the original page.

    At the moment I can not get the javascript to work at all, I am guessing this is due to form being echo from getuser.php. The javascript works fine when not using ajax.

    Everything else in the form works fine.

    If anyone has any ideas please get back to me, thanks.
    Last edited by PeejAvery; July 19th, 2010 at 01:43 PM. Reason: Added code tags.

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

    Re: AJAX and javascript form validation

    You have not included nearly enough code for us to help debug. All you've pasted is a small portion of the AJAX call.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Apr 2011
    Posts
    2

    Re: AJAX and javascript form validation

    Hi
    Please give us more detail

  4. #4
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,867

    Re: AJAX and javascript form validation

    Welcome to the forums, ronty.

    Please keep your posts relevant. This thread is already a year old.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center