Writing Javascript to a specific <td> tag.

Posted on 2008-06-12
Medium Priority
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?
<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;}
<form action="submitpage.htm"
onsubmit="return validate_form(this)"
Email: <input type="text" name="email" size="30">
<input type="submit" value="Submit"> 
</form><table width="200" border="1">
    <td id="tel">&nbsp;</td>

Open in new window

Question by:agulaid
1 Comment
LVL 11

Accepted Solution

JohnSixkiller earned 2000 total points
ID: 21768381
Hi, use

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

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

627 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