The page selects some things from a table in a database so that the user can use that as a reference. Also, there is a query to get the count of the number of items in the table so that the user can't ask for a value more than there is available. Afterwards, there will be a number textbox that will ask for a user on how many steps they want to use. They will be bounded to use a number that is 1 up until the count for the number of items in the table.
Once they hit the submit button, I want there to be X amount of dropdown menus with the numbers ranging from 1 to the COUNT of the items from the table. So, I know I have to use two for loops(one for the user input for amount of steps they want and the other for the count of items to be put in the dropdown)
I have never used a user's input on the same page in HTML and javascript/jquery to create such a thing before. Is it possible? This is what I have so far
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"> </script>
<script>
$(document).ready(function()
{
});
</script>
</head>
<body>
<table>
<?php
echo "<h3>This is the key</h3>";
while(mysqli_stmt_fetch($stmt))
{
echo "<tr>";
echo "<td> $CheckListID</td>";
echo "<td>$Description</td>";
echo "</tr>";
}
mysqli_stmt_close($stmt);
mysqli_close($conn);
?>
</table>
<br>How many steps do you want for this ticket type?
<br>Pick a number between 1 and <?php echo $count; ?>
<form method="GET">
<input type="number" id="numOfSteps" name="numOfSteps" min="1" max="<?php echo $count; ?>" />
<button type="button" id="numOfStepsButton">Submit</button>
<select name="steps" id="steps-select">
<?php
for($i = 1; $i <= $count; $i++)
{
echo "<option value='$i'>$i</option>";
}
?>
</select>
</form>
</body>
</html>

New Topic/Question
Reply


MultiQuote


|