Solved

Writing Javascript to a specific <td> tag.

Posted on 2008-06-12
1
2,167 Views
Last Modified: 2013-11-19
I would like to write the Javascript error to id"tel" <td> tag, on the same page. How would i go about doing this?
<html>
<head>
<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {document.write(alerttxt);return false;}
else {return true}
}
}function validate_form(thisform)
{
with (thisform)
{
if (validate_required(email,"Email must be filled out!", 'tel')==false)
  {email.focus();return false;}
}
}
</script>
</head><body>
<form action="submitpage.htm"
onsubmit="return validate_form(this)"
method="post">
Email: <input type="text" name="email" size="30">
<input type="submit" value="Submit"> 
</form><table width="200" border="1">
  <tr>
    <td id="tel">&nbsp;</td>
  </tr>
</table>
 
</body></html>

Open in new window

0
Comment
Question by:agulaid
1 Comment
 
LVL 11

Accepted Solution

by:
JohnSixkiller earned 500 total points
ID: 21768381
Hi, use

document.getElementById("tel").innerHTML = alerttxt;
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question