Link to home
Start Free TrialLog in
Avatar of jws2bay
jws2bay

asked on

Ajax php/mysql reply into html table

Hi Guys,

I'm working in a php/mysql environment. I have a page where I enter a zip code and using ajax it should display the salesman's name and phone.

in my php file I am sending the results back using:

 echo "<tr>";
 echo  "<td>". $row->Name ."</td></tr>";
 echo  "<tr><td>".$ row->Cell_Phone ."</td></tr>";

when I get it back from the php file I am inserting it into a div with an id=Nametxt, and into a text field  id=Email  using:


document.getElementById('Nametxt').innerHTML=data;      
      
$("#Email").val(data);


RESULTS

The div shows:                Dave Brown888-452-7899

The text field shows this:         <td>Dave Brown</td></tr><tr><td>888-452-7899</td></tr>

Why doesn't the table show correctly in the div?


I want it to be:                Dave Brown
                                       888-452-7899
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jws2bay
jws2bay

ASKER

Man...I hate tripping over the obvious.   It works.

Thanks for the help

Have a great day
You're welcome, glad to help.