I have a little bit complicated situation with codes but I made an easy example so that It is easier for you to understand what I actually need.
HTML:
<html>
<body>
<input type="button" value="Increase" name="increase" id="increase"></input>
<input type="button" value="Submit" name="submit" id="submit"></input>
</body>
</html>
Javascript:
$(document).ready(function() {
$count = 1;
$('input').click(function() {
$count++;
});
});
And the idea of all this web-page:
1)Click few times on button "Increase";
2)The javascript variable $count increases each time You clicked on that button;
3)When You click button "Submit", it makes php loop that repeats $count times and each repeating time it makes new record in some database table. Here is the example of possible php for loop:
for($i=1; $i<=$count; $i++) {
//Here makes new record in some database table. For example, it makes some tables rows "Number" = $i; <-- This is not important in my problem.
}
The question is about middle part of declaring for loop: "$i<=$count" - how it is possible to tell until what point I want this loop with variable, if that variable was made and increased in Javascript language? :?
$
as a JS variable name. But I refer to omitting thevar
in front of it! – DOC ASAREL Jan 9 at 23:16