I am creating a page which dynamically creates input fields using jquery on the click of add button. It is working for Input field but not working for select field. The select field is as it is repeated without the change of name field. So iam having problem in getting these details via $_GET. Plz give a solution asap.
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link href="nietsms.css" rel="stylesheet" type="text/css" />
<title> NIET Store Management System BY SDC </title>
<script type="text/javascript" src="http://cachefile.net/scripts/jquery/1.2.3/jquery-1.2.3.min.js"></script>
<script type="text/javascript">
$(function(){
var newRowNum = 0;
$('#addnew').click(function(){
newRowNum += 1;
var addRow = $(this).parent().parent();
var newRow = addRow.clone();
$('input', addRow).val('');
$('td:first-child', newRow).html(newRowNum);
$('input', newRow).each(function(i){
var newID = newRowNum + '_' + i;
$(this).attr('id',newID).attr('name',newID);
});
addRow.before(newRow);
Replace
and
with
and
$("input")returns only nodes of type “input”, while “:input” is a jQuery pseudoselector which targets inputs, selects, options etc.