I have a dynamic text box that allows the user to add / remove. Firstly, the field will display records from the database.
$count = 1;
foreach($parts as $part)
{
echo "<input type=\"hidden\" class=\"countNumber\" value=\"".$count."\">";
echo $count++;
}
And this is my jQuery dynamic text box.
JSFIDDLE : DEMO
I need to increase my number as soon as the user clicked +. For example, if my database consists of 5 records, then the account will be 1,2,3,4,5, and then, as soon as the user clicks the button to add a dynamic text field, the number will be continued from the previous account, and it will become 6,7,8.... Again, if the user pressed the button -, the counter will be reordered again.
But I do not know how to do this. Any help / guidance would be highly appreciated
Sollo source
share