Solved

jquery clear one form field

Posted on 2012-03-24
2
339 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
Comment Utility
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
Comment Utility
Thanks for the help
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now