?
Solved

jquery clear one form field

Posted on 2012-03-24
2
Medium Priority
?
357 Views
Last Modified: 2012-03-24
Hello I need to clear one form field when a function is executed.  I want to use jquery but I do not know the syntax.  

if(type=='MEDI') {
			$("#profile_1_box").hide();
			document.account_info.profile_1.value = ""; //change this to jquery
                        $("#profile_2_box").hide();
			document.account_info.profile_2.value = ""; //change this to jquery
			$("#restaurant_type_box").hide();
			document.account_info.restaurant_type.value = ""; //change this to jquery
		    }

Open in new window

0
Comment
Question by:Luey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
designatedinitializer earned 1500 total points
ID: 37761494
if(type=='MEDI') {
			$("#profile_1_box").hide();
			$("#profile_1").val(""); 
                        $("#profile_2_box").hide();
			$("#profile_2").val(""); 
			$("#restaurant_type_box").hide();
			$("#restaurant_type").val(""); 
		    }

Open in new window

0
 

Author Closing Comment

by:Luey
ID: 37761509
Thanks for the help
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

801 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