Process TinyMCE validation on submit, fix warning w/multselect
This commit is contained in:
parent
d563f8381b
commit
b7670b6f2b
13
index.php
13
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) {
|
||||||
@ -1111,7 +1111,7 @@ function print_add_ticket()
|
|||||||
<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>
|
||||||
@ -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);
|
||||||
@ -1147,6 +1147,7 @@ function print_add_ticket()
|
|||||||
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");
|
||||||
|
$('#message-group').addClass('has-error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user