I have 2 input elements which I select start and end date using JavaScript:
<form name="form" method="POST" action="accesari.php">
<p>FROM:
<input type="text" id="min" name="min">
</p>
<p>TO:
<input type="text" id="max" name="max">
</p>
<input type="submit" name="submit"/>
</form>
</head>
<body>
<script>
$(document).ready(function() {
$("#min").datepicker({
dateFormat: 'd-mm-yy',
onSelect: function(dateText, inst) {
$("#min").text(dateText);
}
});
});
</script>
<script>
$(document).ready(function() {
$("#max").datepicker({
dateFormat: 'd-mm-yy',
onSelect: function(dateText, inst) {
$("#max").text(dateText);
}
});
});
</script>
Then, in php I have another form which I use to select the client from a dropdown list filled with values from a SQL table:
echo ('<form action="accesari.php" method="post">');
$sql=mysqli_query($aBD->con,"SELECT DISTINCT DenClient FROM $tabel WHERE DenClient!='xxxx'");
if(mysqli_num_rows($sql)){
$select= '<select name="select">';
$select.= '<option> </option>';
while($rs=mysqli_fetch_array($sql)){
$select.='<option>'.$rs['DenClient'].'</option>';
}
}
$select.='</select>';
echo $select;
echo ('<input type="submit" name="submit"/>
</form>');
if ( isset( $_POST['submit'] ) ) {
////is submitted
$client = $_POST['select'];
// //DO STUFF WITH DATA
}
I would like to submit all of it at once. Is that possible? Thanks in advance,