I would like to test my button can get the current value from the date's textbox? I got the value of submit button but I couldn't find any code get name of the button. So what should I call I'm able to view the value?
$form_button_layout = '<button class="btn" name="oprf" value="view-log" type="submit">View</button>';
<form class="well form-inline" method="post"<?= $form_action_override; ?>>
I don't think this works consitently in all browsers. Better to work with a customized name
attribute.
If you'd like to get the value of 'oprf' above, then:
$value = $_POST['obrf'];
Should do it in php.
You can try this one
if(isset($_POST['oprf'])) {
echo $_POST['oprf'];
}
Hope this helps
Add type property with submit type="submit"
to button tag this will submit the form then receive the form inputs value in php script with super global variable $_POST['input name']
or $_GET[]
wdepends on from action property value by default GET.
You can do:
if ($_POST['oprf'] == '' || $_POST['oprf'] == NULL) {
//this checks to see if there has been a value that was sent with the
//form
}
I usually use isset for cookies.