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('N ametxt').i nnerHTML=d ata;
$("#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
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('N
$("#Email").val(data);
RESULTS
The div shows: Dave Brown888-452-7899
The text field shows this: <td>Dave Brown</td></tr><tr><td>888
Why doesn't the table show correctly in the div?
I want it to be: Dave Brown
888-452-7899
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome, glad to help.
ASKER
Thanks for the help
Have a great day