Solved

Writing Javascript to a specific <td> tag.

Posted on 2008-06-12
1
2,165 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to count occurrences of each item in an array.

919 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now