jquery - How to select all inputs with type="text" but with specific names? -


In my form, I have different inputs. What do I want to do now, with all the specific fields of all the text fields Select and then check that all were filled. For example, I have an email, user name, organization and address field.

My goal is to hide a message text area and it will only show if All the fields are mentioned in the values ​​I How can I share these, when all these fields are filled out, the message will show textiera and then any of these areas will be cleared again?

I'm thinking $ ("input [name = email], input [name = address], input [name = user name], input [name = address]") And I do not think it's efficient.

The way the message textaria will populate on the basis of inputs from these areas. Example:

  For whom it may be worried: ....................... Group of texts already assigned ........... ................................... ......................... Regards, username.val () & lt; Email.val () & gt; Institution.val () address.val ()  

Currently, in my form, if the user left the Institute field, then my curriculum would look like this:

< Pre> for whom it may be a concern: ....................... A bunch of texts was handed over ..... ......................................................................................................... ... Regards, the user name.val () & lt; Email.val () & gt; Address.val ()

In this way if I hide the text area until all the fields mentioned are filled, I have my message text ARA prefilled well. .

Apply css class

to all target text inputs <
  $ (document) (work () ($ (': text.required'). ('Input', function () {var Notfilled = $ (': text.required'). (Function () {return! This.value ('.')}}}} (NOTfilled.length) {$ ('.hidefirst') Hide ();} and {$ ('. Hidefirst') Show ( );}}};});  
  & lt; script src =" https://ajax.googleapis.com/ajax/libs/JQuery/1.1.1 / jquery.min.js "& gt; & lt; / Scripts & gt; & lt; form & gt; & lt; input type = "text" name = "field 1" class = "required" />  & Lt; Input type = "text" name = "field 3" class = "required" /> & Lt; Input type = "text" name = "field 4" class = "required" /> & Lt; Input type = "text" name = "field5" class = "required" /> & Lt; Input type = "text" name = "field 6" class = "required" /> & Lt; Textarea class = "hidefirst" name = "info" & gt; Hidden information & lt; / Textarea & gt; & Lt; / Form & gt;  


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -