- Автор темы
- #1
Pozjaluista pomogite u menia vot takaia problema
Dobavlenie proisxodit bez problem, no problema v tom shto esli ti zapolniaesh Value-s a potom nazjimaesh na >>Add<< to shto bilo zapisano v Values stiraetsia.
pomogite pozjaluista.
Dobavlenie proisxodit bez problem, no problema v tom shto esli ti zapolniaesh Value-s a potom nazjimaesh na >>Add<< to shto bilo zapisano v Values stiraetsia.
pomogite pozjaluista.
Код:
<table id='rent' border='0' cellspacing='0' cellpadding='5' width='100%' style='border:1px solid #666;'>
<tr>
<td width='10' style='border-right:1px solid #666;'> </td>
<td style='border-right:1px solid #666;'>Name</td>
<td width='80' style='border-right:1px solid #666;'>Price</td>
<td width='40'> </td>
</tr>
<tr>
<td width='10' style='border-right:1px solid #666;border-top:1px solid #666;'>1</td>
<td style='border-right:1px solid #666;border-top:1px solid #666;'><input type='text' name='r_name1' style='width:90%;' /></td>
<td width='80' style='border-right:1px solid #666;border-top:1px solid #666;'><input type='text' name='r_price1' style='width:92%;' /></td>
<td width='40' style='border-top:1px solid #666;'><a href='javascript:' onClick='AddRent();' >Add +</a></td>
</tr>
</table>
<script>
var count=2;
function AddRent()
{
if(count<=100)
{
document.getElementById('rent').innerHTML+="<tr><td width='10' style='border-top:1px solid #666;border-right:1px solid #666;'>"+count+"</td><td style='border-right:1px solid #666;border-top:1px solid #666;' id='r_name_a"+count+"' ><input type='text' name='r_name"+count+"' style='width:90%;' /></td><td style='border-right:1px solid #666;border-top:1px solid #666;' id='r_price_a"+count+"' width='80'><input type='text' name='r_price"+count+"' style='width:92%;' /></td><td width='40' style='border-top:1px solid #666;' id='r_quest_a"+count+"'><a id='a"+count+"' href='javascript:' onClick='DeleteRent(this);' >Delete</a></td></tr>";
count++;
}
}
</script>