jquery - Using javascript to get the values of multiple fields and add them to a table -


I am creating a script that takes the value of the field and places it in a table for verification, though this is , The user is able to add multiple fields (up to 5) and each field has its own ID. Therefore, when a user uses values, then I want to take my script from all that area (even if it has been added) And in the table Confidence can be how I will be able to do this? Adds a 'set' to the user, click Add Chart The user is called a 'set' > </ P> <p> <strong> The user adds another 'set' (up to 5). </ Strong> <img src =

Set ', then they appear in the Jepson Charts section. Enter image details here
I need to get these values

  & lt; Div id = "chart" & gt; & Lt; H3 & gt; Japson Charts & lt; / H3 & gt; & Lt; Fieldset & gt; & Lt; Label & gt; Airport Identifier & lt; / Labels & gt; & Lt; Input type = "text" name = "air_id_1" id = "air_id_1" /> & Lt; / Fieldset & gt; & Lt; Fieldset & gt; & Lt; Label & gt; Chart Identifier & lt; / Labels & gt; & Lt; Input type = "text" name = "chart_id_1" id = "chart_id_1" /> & Lt; / Fieldset & gt; & Lt; Fieldset & gt; & Lt; Label & gt; Chart Details & lt; / Label & gt; & Lt; Input type = "text" name = "chart_desc_1" id = "chart_desc_1" /> & Lt; / Fieldset & gt; & Lt; / Div & gt;   

Allows the user to add up to 5 different charts.

  var jep_num = 1; $ ("#Add_chart") ("Vclick", function (ev) {jep_num + = 1; if (jep_num & lt; = 5) {$ ("# chart"). Append ("& lt; fieldet>  fieldset style = 'margin-left: 0.45%' & gt; & lt ; Input type = 'text' name = 'chart_id_' + jep_num + "'id =' chart_id_" + jep_num + "'/> gt; & lt; / fieldet & gt; fieldset style =' margin-left: 0.4% ' & Gt; & lt; input type = 'text' name = 'chart_desc_ "+ jep_num +"' id = 'chart_desc_ "+ jep_num +"' /></fileset>").trigger(crecre ");} Ev.preventDefault ();})   

The table where the chart should be added

  
Jeppenes Charts
gt; & lt; div & gt; Lt; div id = "air_id_field" class = "table_field">
gt; & lt; Div id = "chart_id_field" class = "table_field" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div square = "half" & gt; & Lt; Div class = "full" & gt; & Lt; Div id = "chart_desc_field" class = "table_field" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;

I hope that I came to understand with my own wave, if not, then tell me and I will try to clarify. I also know how to use MySQL and PHP, and I was hoping to avoid doing this with this special feature. But, if I need it then.

You should add each field and the added class. Apart from this, you need to wrap all three related fields in a three divisions.

  & lt; Div id = "charts" & gt; & Lt; H3 & gt; Japson Charts & lt; / H3 & gt; & Lt; Div class = "chart-fields" & gt; & Lt; Fieldset & gt; & Lt; Label & gt; Airport Identifier & lt; / Labels & gt; & Lt; Input class = "air-input" type = "text" name = "air_id_1" id = "air_id_1" /> & Lt; / Fieldset & gt; & Lt; Fieldset & gt; & Lt; Label & gt; Chart Identifier & lt; / Labels & gt; & Lt; Input class = "chart-input" type = "article" name = "chart_id_1" id = "chart_id_1" /> & Lt; / Fieldset & gt; & Lt; Fieldset & gt; & Lt; Label & gt; Chart Details & lt; / Label & gt; & Lt; Input class = "chart-desc-input" type = "text" name = "chart_desc_1" id = "chart_desc_1" /> & Lt; / Fieldset & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

Then you can go with one after all of your sets and get such values ​​and then what you want to do with them:

  $ ('.charts-fieldet') each (function () {var air = $ ('. Air-input', $ (this)). Val (); var chart = $ ('chart -input ', $ (this)). Val (); var chartDesc = $ (' chart-desc-input ', $ (this)). Val ();});    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -