Process TinyMCE validation on submit, fix warning w/multselect
This commit is contained in:
parent
d563f8381b
commit
b7670b6f2b
95
index.php
95
index.php
@ -187,7 +187,7 @@ function print_add_ticket()
|
|||||||
<div class="footerWithBorder"></div>
|
<div class="footerWithBorder"></div>
|
||||||
<div class="blankSpace"></div>
|
<div class="blankSpace"></div>
|
||||||
<form class="form-horizontal" role="form" method="post" action="submit_ticket.php?submit=1" name="form1"
|
<form class="form-horizontal" role="form" method="post" action="submit_ticket.php?submit=1" name="form1"
|
||||||
enctype="multipart/form-data" data-toggle="validator">
|
enctype="multipart/form-data" data-toggle="validator" onsubmit="return validateRichText();">
|
||||||
<!-- Contact info -->
|
<!-- Contact info -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="name" class="col-sm-3 control-label"><?php echo $hesklang['name']; ?>: <font
|
<label for="name" class="col-sm-3 control-label"><?php echo $hesklang['name']; ?>: <font
|
||||||
@ -348,7 +348,7 @@ function print_add_ticket()
|
|||||||
$required = $v['req'] ? 'required' : '';
|
$required = $v['req'] ? 'required' : '';
|
||||||
$v['req'] = $v['req'] ? '<span class="important">*</span>' : '';
|
$v['req'] = $v['req'] ? '<span class="important">*</span>' : '';
|
||||||
|
|
||||||
if ($v['type'] == 'checkbox') {
|
if ($v['type'] == 'checkbox' || $v['type'] == 'multiselect') {
|
||||||
$k_value = array();
|
$k_value = array();
|
||||||
if (isset($_SESSION["c_$k"]) && is_array($_SESSION["c_$k"])) {
|
if (isset($_SESSION["c_$k"]) && is_array($_SESSION["c_$k"])) {
|
||||||
foreach ($_SESSION["c_$k"] as $myCB) {
|
foreach ($_SESSION["c_$k"] as $myCB) {
|
||||||
@ -627,7 +627,7 @@ function print_add_ticket()
|
|||||||
<div class="help-block with-errors"></div>
|
<div class="help-block with-errors"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group" id="message-group">
|
||||||
|
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<textarea placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" name="message"
|
<textarea placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" name="message"
|
||||||
@ -698,7 +698,7 @@ function print_add_ticket()
|
|||||||
|
|
||||||
$v['req'] = $v['req'] ? '<span class="important">*</span>' : '';
|
$v['req'] = $v['req'] ? '<span class="important">*</span>' : '';
|
||||||
|
|
||||||
if ($v['type'] == 'checkbox') {
|
if ($v['type'] == 'checkbox' || $v['type'] == 'multiselect') {
|
||||||
$k_value = array();
|
$k_value = array();
|
||||||
if (isset($_SESSION["c_$k"]) && is_array($_SESSION["c_$k"])) {
|
if (isset($_SESSION["c_$k"]) && is_array($_SESSION["c_$k"])) {
|
||||||
foreach ($_SESSION["c_$k"] as $myCB) {
|
foreach ($_SESSION["c_$k"] as $myCB) {
|
||||||
@ -1084,34 +1084,34 @@ function print_add_ticket()
|
|||||||
endif;
|
endif;
|
||||||
|
|
||||||
if ($hesk_settings['submit_notice']) {
|
if ($hesk_settings['submit_notice']) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
<b><?php echo $hesklang['before_submit']; ?></b>
|
<b><?php echo $hesklang['before_submit']; ?></b>
|
||||||
<ul>
|
<ul>
|
||||||
<li><?php echo $hesklang['all_info_in']; ?>.</li>
|
<li><?php echo $hesklang['all_info_in']; ?>.</li>
|
||||||
<li><?php echo $hesklang['all_error_free']; ?>.</li>
|
<li><?php echo $hesklang['all_error_free']; ?>.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<b><?php echo $hesklang['we_have']; ?>:</b>
|
<b><?php echo $hesklang['we_have']; ?>:</b>
|
||||||
<ul>
|
<ul>
|
||||||
<li><?php echo hesk_htmlspecialchars($_SERVER['REMOTE_ADDR']) . ' ' . $hesklang['recorded_ip']; ?></li>
|
<li><?php echo hesk_htmlspecialchars($_SERVER['REMOTE_ADDR']) . ' ' . $hesklang['recorded_ip']; ?></li>
|
||||||
<li><?php echo $hesklang['recorded_time']; ?></li>
|
<li><?php echo $hesklang['recorded_time']; ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-9 col-md-offset-3">
|
<div class="col-md-9 col-md-offset-3">
|
||||||
<input type="hidden" id="latitude" name="latitude" value="E-0">
|
<input type="hidden" id="latitude" name="latitude" value="E-0">
|
||||||
<input type="hidden" id="longitude" name="longitude" value="E-0">
|
<input type="hidden" id="longitude" name="longitude" value="E-0">
|
||||||
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>">
|
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>">
|
||||||
<input type="submit" value="<?php echo $hesklang['sub_ticket']; ?>"
|
<input type="submit" value="<?php echo $hesklang['sub_ticket']; ?>"
|
||||||
class="btn btn-default>
|
class="btn btn-default">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
@ -1119,10 +1119,10 @@ function print_add_ticket()
|
|||||||
$('#screen-resolution-width').prop('value', screen.width);
|
$('#screen-resolution-width').prop('value', screen.width);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
} // End IF submit_notice
|
} // End IF submit_notice
|
||||||
else {
|
else {
|
||||||
?>
|
?>
|
||||||
<div class=" row">
|
<div class=" row">
|
||||||
<div class="col-md-9 col-md-offset-3">
|
<div class="col-md-9 col-md-offset-3">
|
||||||
<input type="hidden" id="latitude" name="latitude" value="E-0">
|
<input type="hidden" id="latitude" name="latitude" value="E-0">
|
||||||
@ -1131,7 +1131,7 @@ function print_add_ticket()
|
|||||||
<input type="hidden" id="screen-resolution-width" name="screen_resolution_width">
|
<input type="hidden" id="screen-resolution-width" name="screen_resolution_width">
|
||||||
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>">
|
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>">
|
||||||
<input class="btn btn-default" type="submit"
|
<input class="btn btn-default" type="submit"
|
||||||
value="<?php echo $hesklang['sub_ticket']; ?>" onclick="validateRichText()">
|
value="<?php echo $hesklang['sub_ticket']; ?>">
|
||||||
<script>
|
<script>
|
||||||
$('#screen-resolution-height').prop('value', screen.height);
|
$('#screen-resolution-height').prop('value', screen.height);
|
||||||
$('#screen-resolution-width').prop('value', screen.width);
|
$('#screen-resolution-width').prop('value', screen.width);
|
||||||
@ -1140,24 +1140,25 @@ function print_add_ticket()
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
} // End ELSE submit_notice
|
} // End ELSE submit_notice
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
function validateRichText() {
|
function validateRichText() {
|
||||||
var content = tinyMCE.get("message").getContent();
|
var content = tinyMCE.get("message").getContent();
|
||||||
if (content == '') {
|
if (content == '') {
|
||||||
$('#message-help-block').text("This can't be empty");
|
$('#message-help-block').text("This can't be empty");
|
||||||
return false;
|
$('#message-group').addClass('has-error');
|
||||||
}
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
</script>
|
return true;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- Do not delete or modify the code below, it is used to detect simple SPAM bots -->
|
<!-- Do not delete or modify the code below, it is used to detect simple SPAM bots -->
|
||||||
<input type="hidden" name="hx" value="3"/><input type="hidden" name="hy" value=""/>
|
<input type="hidden" name="hx" value="3"/><input type="hidden" name="hy" value=""/>
|
||||||
<!-- >
|
<!-- >
|
||||||
<input type="text" name="phone" value="3" />
|
<input type="text" name="phone" value="3" />
|
||||||
< -->
|
< -->
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user