在我的網站上。我有問題與JQuery。我不是這裏的專家,所以請理解。提交JQuery加載問題
這裏是我正在使用它的工作腳本,但是,一旦你點擊提交btn。即使你有一個不完整的信息,表單加載器仍然顯示處理。即使我的董事會說:請填寫你的...,仍然加載gif運行。
腳本:
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script>
$(document).on("click", ".show-page-loading-msg", function() {
var $this = $(this),
theme = $this.jqmData("theme") || $.mobile.loader.prototype.options.theme,
msgText = $this.jqmData("msgtext") || $.mobile.loader.prototype.options.text,
textVisible = $this.jqmData("textvisible") || $.mobile.loader.prototype.options.textVisible,
textonly = !!$this.jqmData("textonly");
html = $this.jqmData("html") || "";
$.mobile.loading('show', {
text: msgText,
textVisible: textVisible,
theme: theme,
textonly: textonly,
html: html
});
})
.on("click", ".hide-page-loading-msg", function() {
$.mobile.loading("hide");
});
</script>
我的PHP代碼:(這是不完整的,我只是想分享的端部)
<div class="form-group">
<div class="col-md-5 col-sm-8 col-xs-8">
<?if (Core::config('general.recaptcha_active')):?>
<?=Captcha::recaptcha_display()?>
<div id="recaptcha3"></div>
<?else:?>
<?= FORM::label('captcha', _e('Captcha'), array('for'=>'captcha'))?>
<span id="helpBlock" class="help-block"><?=captcha::image_tag('publish_new')?></span>
<?= FORM::input('captcha', "", array('class' => 'form-control', 'id' => 'captcha', 'required', 'data-error' => __('Captcha is not correct')))?>
<?endif?>
</div>
</div>
<?endif?>
<div class="control-group">
<div class="controls">
<?= FORM::button('submit', __('<i class="glyphicon glyphicon-send"></i> Publish New Ad'), array('type'=>'submit', 'data-corners'=>'false', 'class'=>'pub-new show-page-loading-msg', 'data-theme'=>'b', 'data-textonly'=>'false', 'data-msgtext'=>'Processing....', 'data-textvisible'=>'true', 'action'=>Route::url('post_new',array('controller'=>'new','action'=>'index'))))>
</div>
</div>
</fieldset>
<?= FORM::close()?>
瞭解更多請你可以去這裏,但你需要使用手機查看:https://linkinads.com/publish-new.html或在這裏的YouTube視頻:https://www.youtube.com/watch?v=dKzabE2eJN0
你的意思是這樣的:https://codepen.io/DonPramis-dubai/pen/WjBbZY –
或者我需要在這裏編輯表單的開頭:<= FORM :: open(Route :: url('post_new' ,'array'('controller'=>'new','action'=>'index')),array('class'=>'form-horizontal','enctype'=>'multipart/form-data',' data-ajax'=>'false'))?>' –
請在這裏顯示我不是專家。謝謝 –