•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,196 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,191 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 599 | Replies: 2
![]() |
•
•
Join Date: Feb 2008
Location: South Carolina
Posts: 17
Reputation:
Rep Power: 1
Solved Threads: 0
Hey guys, so i'm not great with JavaScript since i mostly do HTML and C++...
ok, so i have a site with a "contact" box that sends me the users message. i want the text to clear when the user clicks on it, but for some reason, i can't get it right...
any help?
this is the html so far...
...
<form action="gdform.asp" method="post">
<input type="hidden" name="subject" value="Message from User" />
<input type="hidden" name="redirect" value="index.htm" />
<FONT size="2"><p align="center">
<INPUT type="text" name="Email Address" value="your email" id="Email Address" size="40"></text>
<FONT size="2"><p align="center">
<textarea name="Message" id="Message" cols="30" rows="5">message...</textarea>
<p align="center"><INPUT type="submit" name="Submit" value="Send">
<INPUT type="reset" name="reset" value="Cancel">
</FORM>
ok, so i have a site with a "contact" box that sends me the users message. i want the text to clear when the user clicks on it, but for some reason, i can't get it right...
any help?
this is the html so far...
...
<form action="gdform.asp" method="post">
<input type="hidden" name="subject" value="Message from User" />
<input type="hidden" name="redirect" value="index.htm" />
<FONT size="2"><p align="center">
<INPUT type="text" name="Email Address" value="your email" id="Email Address" size="40"></text>
<FONT size="2"><p align="center">
<textarea name="Message" id="Message" cols="30" rows="5">message...</textarea>
<p align="center"><INPUT type="submit" name="Submit" value="Send">
<INPUT type="reset" name="reset" value="Cancel">
</FORM>
•
•
Join Date: Feb 2008
Location: bangalore
Posts: 19
Reputation:
Rep Power: 1
Solved Threads: 2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script type="text/javascript">
function ValidateEmail(){
document.getElementById('Email Address').innerText = "";
}
function ValidateMessage(){
document.getElementById('Message').innerText = "";
}
function Validate(){
document.getElementById('Email Address').innerText = "";
document.getElementById('Message').innerText = "";
}
</script>
</HEAD>
<BODY>
<form action="gdform.asp" method="post">
<input type="hidden" name="subject" value="Message from User" />
<input type="hidden" name="redirect" value="index.htm" />
<p align="center">
<INPUT type="text" name="Email Address" value="your email" id="Email Address" size="40" onClick="ValidateEmail()"></p>
<p align="center"><textarea name="Message" id="Message" cols="30" rows="5" onClick="ValidateMessage()">message...</textarea></p>
<p align="center"><INPUT type="submit" name="Submit" value="Send">
<INPUT type="button" name="reset" value="Cancel" onClick="Validate()">
</p>
</FORM>
</BODY>
</HTML>
I HOPE THIS WILL HELP YOU
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script type="text/javascript">
function ValidateEmail(){
document.getElementById('Email Address').innerText = "";
}
function ValidateMessage(){
document.getElementById('Message').innerText = "";
}
function Validate(){
document.getElementById('Email Address').innerText = "";
document.getElementById('Message').innerText = "";
}
</script>
</HEAD>
<BODY>
<form action="gdform.asp" method="post">
<input type="hidden" name="subject" value="Message from User" />
<input type="hidden" name="redirect" value="index.htm" />
<p align="center">
<INPUT type="text" name="Email Address" value="your email" id="Email Address" size="40" onClick="ValidateEmail()"></p>
<p align="center"><textarea name="Message" id="Message" cols="30" rows="5" onClick="ValidateMessage()">message...</textarea></p>
<p align="center"><INPUT type="submit" name="Submit" value="Send">
<INPUT type="button" name="reset" value="Cancel" onClick="Validate()">
</p>
</FORM>
</BODY>
</HTML>
I HOPE THIS WILL HELP YOU
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
ads adsense cross-browser javascript menu with few lines of code firefox google html javascript javascript smooth scrolling scroll smoothly window document position javascript tab menu with rounded corners generator link prevent javascript menu from getting hidden under flash movies preventing the delay when src attribute of the images set via javascript revenue split text into substrings seperated more than one character text unit
- Previous Thread: Problems with Java and Web conferencing
- Next Thread: Cannont submit form which holds another form inside it (Works on FF, but not on IE)



Linear Mode