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 This is a method to do this: Demo: That is, to get the Note that if you want to display, this code will be simplified in the Note that because this table breaks through all the selections in the table, it will automatically handle any dynamically added rows. button to another page
$ ("# ok"). ("Click", function () {var output = [], $ chooses = $ ("# s select"), i; (I = 0; i
.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.
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 ());
Comments
Post a Comment