Process TinyMCE validation on submit, fix warning w/multselect

merge-requests/2/head
Mike Koch 9 years ago
parent d563f8381b
commit b7670b6f2b

@ -187,7 +187,7 @@ function print_add_ticket()
<div class="footerWithBorder"></div>
<div class="blankSpace"></div>
<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 -->
<div class="form-group">
<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' : '';
$v['req'] = $v['req'] ? '<span class="important">*</span>' : '';
if ($v['type'] == 'checkbox') {
if ($v['type'] == 'checkbox' || $v['type'] == 'multiselect') {
$k_value = array();
if (isset($_SESSION["c_$k"]) && is_array($_SESSION["c_$k"])) {
foreach ($_SESSION["c_$k"] as $myCB) {
@ -627,7 +627,7 @@ function print_add_ticket()
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="form-group" id="message-group">
<div class="col-sm-12">
<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>' : '';
if ($v['type'] == 'checkbox') {
if ($v['type'] == 'checkbox' || $v['type'] == 'multiselect') {
$k_value = array();
if (isset($_SESSION["c_$k"]) && is_array($_SESSION["c_$k"])) {
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" name="token" value="<?php hesk_token_echo(); ?>">
<input type="submit" value="<?php echo $hesklang['sub_ticket']; ?>"
class="btn btn-default>
class="btn btn-default">
</div>
</div>
<script>
@ -1131,7 +1131,7 @@ function print_add_ticket()
<input type="hidden" id="screen-resolution-width" name="screen_resolution_width">
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>">
<input class="btn btn-default" type="submit"
value="<?php echo $hesklang['sub_ticket']; ?>" onclick="validateRichText()">
value="<?php echo $hesklang['sub_ticket']; ?>">
<script>
$('#screen-resolution-height').prop('value', screen.height);
$('#screen-resolution-width').prop('value', screen.width);
@ -1147,6 +1147,7 @@ function print_add_ticket()
var content = tinyMCE.get("message").getContent();
if (content == '') {
$('#message-help-block').text("This can't be empty");
$('#message-group').addClass('has-error');
return false;
}
return true;

Loading…
Cancel
Save