Click here to Skip to main content
15,903,632 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have one dropdownlist,by selecting item of it,it will add row which include column_Name two textboxes in row using javascript.
I want too access the value of that textboxes row by row and filter table.

can any one help me
Posted
Updated 11-Apr-14 1:31am
v2

You can use serialize()Method of jquery

The serialize() method creates a URL encoded text string by serializing form values.
You can select one or more form elements (like input and/or text area), or the form element itself.
The serialized values can be used in the URL query string when making an AJAX request.

$("button").click(function(){
$("div").text($("form").serialize());
});
 
Share this answer
 
v2
Comments
aparnaChandras 11-Apr-14 3:44am    
function addRow(in_tbl_name) {
var serBt = document.getElementById("in_tbl_name");


var tbody = document.getElementById(in_tbl_name).getElementsByTagName("TBODY")[0];

// create row
var row = document.createElement("TR");

// create table cell 1
var td1 = document.createElement("TD")
var strHtml1 = selectedField;

td1.innerHTML = strHtml1;
// create table cell 2
var td2 = document.createElement("TD")
var strHtml2 = "<input id="txt1" type='text'/>";
var td3 = document.createElement("TD")
var strHtml3 = "<input id="txt2" type='text'/>";
td3.innerHTML = strHtml3;

row.appendChild(td1);
row.appendChild(td2);
row.appendChild(td3);

tbody.appendChild(row);


}
this is my code to create dynamic text box ,now could you please explain how can i use serialize()method
On Button click function use
XML
<script>
$(document).ready(function(){
  $("button").click(function(){
    var a =($("form").serialize());
alert(a);
  });
});
</script>


write this code you get all control value in variable "a"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900