I have i page where i ma using to create dynamic rows using jQuery.
I also use this library "sisyphus.js" and "sisyphus.min.js" and "jquery-1.7.min.js".
I am not able to preserve my dynamically rows in my form.
I paste code here.
<script type="text/javascript" src="jquery-1.7.min.js"></script>
<script src="sisyphus.js" language="javascript"></script>
<script language="javascript" >
jQuery('#form1').sisyphus();
jQuery('form').sisyphus({timeout: 5});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('.del').live('click',function(){
$(this).parent().parent().remove();
});
$('.add').live('click',function(){
$(this).val('Delete');
$(this).attr('class','del');
var appendTxt = "<tr><td><select name='ptype[]' ><option value='1' >ONE</option><option value='2' >TWO</option></select></td><td><select name='product[]' ><option value='3' >ONE333</option><option value='4' >TWO444</option></select></td><td><input type='text' name='dsc[]' /></td><td><input type='text' name='qty[]' /></td></td><td><input type='button' class='add' value='Add More' /></td></tr>";
$("tr:last").after(appendTxt);
});
});
</script>
<style>
.add{
border-top: 1px solid #96d1f8;
background: #65a9d7;
background: -webkit-gradient(linear, left top, left bottom, from(#3e779d), to(#65a9d7));
background: -webkit-linear-gradient(top, #3e779d, #65a9d7);
background: -moz-linear-gradient(top, #3e779d, #65a9d7);
background: -ms-linear-gradient(top, #3e779d, #65a9d7);
background: -o-linear-gradient(top, #3e779d, #65a9d7);
padding: 2px 4px;
-webkit-border-radius: 40px;
-moz-border-radius: 40px;
border-radius: 40px;
-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
box-shadow: rgba(0,0,0,1) 0 1px 0;
text-shadow: rgba(0,0,0,.4) 0 1px 0;
color: white;
font-size: 11px;
font-family: Georgia, serif;
text-decoration: none;
vertical-align: middle;
}
.add:hover {
border-top-color: #28597a;
background: #28597a;
color: #ccc;
}
.add:active {
border-top-color: #1b435e;
background: #1b435e;
}
.del{
border-top: 1px solid #96d1f8;
background: #65a9d7;
background: -webkit-gradient(linear, left top, left bottom, from(#3e779d), to(#65a9d7));
background: -webkit-linear-gradient(top, #3e779d, #65a9d7);
background: -moz-linear-gradient(top, #3e779d, #65a9d7);
background: -ms-linear-gradient(top, #3e779d, #65a9d7);
background: -o-linear-gradient(top, #3e779d, #65a9d7);
padding: 2px 4px;
-webkit-border-radius: 40px;
-moz-border-radius: 40px;
border-radius: 40px;
-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
box-shadow: rgba(0,0,0,1) 0 1px 0;
text-shadow: rgba(0,0,0,.4) 0 1px 0;
color: white;
font-size: 11px;
font-family: Georgia, serif;
text-decoration: none;
vertical-align: middle;
}
.del:hover {
border-top-color: #28597a;
background: #28597a;
color: #ccc;
}
.del:active {
border-top-color: #1b435e;
background: #1b435e;
}
</style>
<form name="form1" id="form1" action="" >
<table id="options-table">
<tr>
<td>Type</td>
<td>Product</td>
<td>Desc</td>
<td>Qty</td>
<td> </td>
</tr>
<tr>
<td><select name="ptype[]" >
<option value="1" >ONE</option>
<option value="2" >TWO</option>
</select></td>
<td><select name="product[]" >
<option value="3" >ONE333</option>
<option value="4" >TWO444</option>
</select></td>
<td><input type="text" name="dsc[]" /></td>
<td><input type="text" name="qty[]" /></td>
<td><input type="button" class="add" value="Add More" /></td>
</tr>
</tr>
</table>
</form>