jQuery Form Observe

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-13 17:43:22

软件介绍

Overview

This plugin observes values of form elements.

When end-user changes any values of input elements, observer shows which values were changed. And observer also alerts to users when they try to move out from the page before submitting changes.
Usage

You can add FormObserve plugin onto any form element.

$(document).ready(function(){
  $('#MyForm').FormObserve();
});

<form id="MyForm">
  <input type="text" value="here's default value" />
  <input type="submit" value="save" />
</form>

If you want to show users the changes, you can add the definition of class 'changed'.

<style>
.changed {
  background-color: red;
}
</style>

After changes have been completed (might be 'onsubmit', 'ajax complete' and so on), you should call FormObserve_save() method.

$('#MyForm').submit(function(){
  if(validation=='ok'){
    $(this).FormObserve_save();
  }
});

Options

changeClass

You can change the class name of changed input-elements.

$(document).ready(function(){
  $('#MyForm').FormObserve({changeClass: "alert-color");
});

Default value is 'changed'.

msg

You can set the alert message.

Default value is "Unsaved changes will be lost.\nReally continue?"

Tips

You can call FormObserve_save() method to each elements.

$('#ajax-button').click(function(){
  // after saving on server
  $(this).FormObserve_save();
});

This plugin is very handy using with jGlycy.

<form jg="FormObserve">
  <input type="text" value="here's default value" />
  <input type="submit" value="save" />
</form>

本文地址:https://codercto.com/soft/d/23307.html

像计算机科学家一样思考Python (第2版)

像计算机科学家一样思考Python (第2版)

[美] 艾伦 B. 唐尼 / 赵普明 / 人民邮电出版社 / 2016-7 / 49.00

本书以培养读者以计算机科学家一样的思维方式来理解Python语言编程。贯穿全书的主体是如何思考、设计、开发的方法,而具体的编程语言,只是提供了一个具体场景方便介绍的媒介。 全书共21章,详细介绍Python语言编程的方方面面。本书从基本的编程概念开始讲起,包括语言的语法和语义,而且每个编程概念都有清晰的定义,引领读者循序渐进地学习变量、表达式、语句、函数和数据结构。书中还探讨了如何处理文件和......一起来看看 《像计算机科学家一样思考Python (第2版)》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具