Solved

jquery clear one form field

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
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 …
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…

756 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