• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2173
  • Last Modified:

Writing Javascript to a specific <td> tag.

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
agulaid
Asked:
agulaid
1 Solution
 
JohnSixkillerCommented:
Hi, use

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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now