Solved

jquery clear one form field

Posted on 2012-03-24
2
347 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 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

696 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