my dog learned polymorphism*
The moose likes Beginning Java and the fly likes Clearing textbox Sorry post got closed for some reason had to repost Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Clearing textbox Sorry post got closed for some reason had to repost

James Hambrick
Ranch Hand

Joined: Sep 04, 2004
Posts: 282

I didnt see a Java Script area but if there is one please move this post into it for me.

I have a simple form


code:
--------------------------------------------------------------------------------

<form action="MAILTO:email@domain.com" method="post" enctype="text/plain">City Name:<input input type="text" name="City Name" ><input type=Submit value="Send"> </form>

--------------------------------------------------------------------------------



I want to clear out the City Name text box when the user clicks the submit button. Ive seen javascripts that clear out the text box when the user clicks inside the textbox(onFocus) and I tried to make it work but could not. I would also like to have the form set the subject line for me too I used to know how in college, but have not used it awhile and got rid of the book. Help!


Visit my blog! http://jameshambrick.com
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

I moved the other post, James! See the enormous link near the top directing you to the post's new location.


[Jess in Action][AskingGoodQuestions]
 
Consider Paul's rocket mass heater.
 
subject: Clearing textbox Sorry post got closed for some reason had to repost
 
Similar Threads
Java Script to clear text box
send variables along with html content
Casting to array of Strings
servlet or jsp page with prefilled forms
displaying multiple rows based on textbox value