mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Do nothing on empty input
This commit is contained in:
@@ -253,6 +253,14 @@
|
||||
$('[class*="buttons"]').css("color", "white");
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function validateForm() {
|
||||
let x = document.forms["searchForm"]["callsign"].value;
|
||||
if (x == "") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
<?php if (!empty($slug)) {
|
||||
$this->CI =& get_instance();
|
||||
if ($this->CI->public_search_enabled($slug) || $this->session->userdata('user_type') >= 2) { ?>
|
||||
<form method="post" action="<?php echo site_url('visitor/search'); ?>" class="form-inline">
|
||||
<form method="post" name="searchForm" action="<?php echo site_url('visitor/search'); ?>" onsubmit="return validateForm()" class="form-inline">
|
||||
<input class="form-control mr-sm-2" id="searchcall" type="search" name="callsign" placeholder="<?php echo lang('menu_search_text'); ?>" <?php if (isset($callsign) && $callsign != '') { echo 'value="'.strtoupper($callsign).'"'; } ?> aria-label="Search">
|
||||
<input type="hidden" name="public_slug" value="<?php echo $slug; ?>">
|
||||
<button class="btn btn-outline-success my-2 my-sm-0" type="submit"><i class="fas fa-search"></i> <?php echo lang('menu_search_button'); ?></button>
|
||||
|
||||
Reference in New Issue
Block a user