html - get data from select option field and set comma separate format using Jquery -


I have a table with the selection list box. My requirement is when I hit the submit button, Get the data and display the price with a different format than a comma.

Here I have attached the image file for your reference.

In this case I have suppressed the button Data to { d: D, SDF: SDF, D: D }.

Demo page:

Note: I have added the button to another page

This is a method to do this:

  $ ("# ok"). ("Click", function () {var output = [], $ chooses = $ ("# s select"), i; (I = 0; i   

Demo:

That is, to get the .text () value of the selected options in each, select by twos After loop pair through and insert that pair into an array then after loop array elements are included in the string separated by comma.

Note that if you want to display, this code will be simplified in the value property of the element element, because the line will be in the loop:

 < Code> output. Push ($ selects.eq (i) .val () + ":" + $ selects.eq (i + 1) .val ());   

Note that because this table breaks through all the selections in the table, it will automatically handle any dynamically added rows.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -