User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Feb 2008
Location: South Carolina
Posts: 17
Reputation: rybo is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
rybo rybo is offline Offline
Newbie Poster

Quick help w/ JavaScript clearing text

  #1  
Feb 23rd, 2008
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>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 2,556
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 115
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Quick help w/ JavaScript clearing text

  #2  
Feb 24th, 2008
All of your tags should be lowercase.

You need JavaScript to do something dynamic such as what you want..
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Feb 2008
Location: bangalore
Posts: 19
Reputation: aravelli is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
aravelli aravelli is offline Offline
Newbie Poster

Solution Re: Quick help w/ JavaScript clearing text

  #3  
Feb 26th, 2008
<!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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 10:31 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC