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

Dynamic Programming

Dynamic Programming

Richard Bellman / Dover Publications / 2003-03-04 / USD 19.95

An introduction to the mathematical theory of multistage decision processes, this text takes a "functional equation" approach to the discovery of optimum policies. The text examines existence and uniq......一起来看看 《Dynamic Programming》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

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

HTML 编码/解码

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具