Solved

jquery clear one form field

Posted on 2012-03-24
2
342 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
2 Comments
 
LVL 7

Accepted Solution

by:
designatedinitializer earned 375 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

806 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