tags:

views:

31

answers:

2

HTML code :

I echo this content in php file, In result i get only the 'Contact Us' Remaining part does not display the html form

<div > Contact Us 
  <form name="profile" action="" method="post"> 
    Name : <input type="text" name="fullname" id="fullname" />
    Email : <input type="text" name="email" id="email" />
    Mobile : <input type="text" name="mobile" id="mobile" />
  </form>
</div> 

Jquery code response :

$.post("contact_us.php",{ user_id:$('#user_id').val(),typ:'contact_us' },
 function(data) {   
   $('#contact_us').html(data); 
});

In contact_us id does not write the contact us form, Please anyone help me

+1  A: 

Have you tried using Firebug?

http://getfirebug.com/

That will let you see what the script is returning.

UPDATE:

You are referencing a container with ID = "contact_us"

$('#contact_us').html(data); 

You need to set the ID of the div you want to replace the content in.

<div id="contact_us"></div>
Whit
Yes i tried , In firebug Net tab Post Response showing full data, but in HTML showing only the 'Contact Us' , it does not show inside form tag content
Sasikumar
A: 

Your HTML isn't valid. You need to close the div tag

<div >
  Contact Us 
  <form name="profile" action="" method="post"> 
    Name : <input type="text" name="fullname" id="fullname" />
  </form>
</div>
mlathe
Yes i closed, but not working
Sasikumar