Populate

码农软件 · 软件分类 · 其他jQuery插件 · 2020-01-15 22:41:24

软件介绍

Populate a form or an element’s child elements using a JSON object.

This plugin supports full PHP naming and deep data structures, as well as checkbox arrays and other non-standard UI controls. The plugin can be used as part of your AJAX toolkit, or for separating server-side code from HTML by populating a form after the page has loaded eg:

$('form').populate({'text':'text', 'radio':1})

and not inline as the page is processed, such as:

<input type="text" name="text" id="text" value="<?php echo $text; ?>" />
<input type="radio" name="radio" id="radio-1" checked="<?php echo $val == 1; ?>" />
<input type="radio" name="radio" id="radio-2" checked="<?php echo $val == 2; ?>" />

Non-form elements

You can also populate non-form controls such as <div>s, by specifiying the id and an identifying attribute (defaults to id):

$('div').populate({'text-1':'text', 'text-2':'More text'})

This can be useful when you want to show the results of a database call, but don't want the text to be editable.

Usage

Just include the PHP JSON class, PHP helper function and of course Populate at the top of your page, and a PHP snippet such as this the bottom:

<?php populate('form', $data); ?/>

Which will output something meaningful like this:

$('form').populate({'text':'text', 'radio':1})

Live Demo

Finally!

I've now FINALLY put up a full set of instructions and a working demo, with examples of:

  • Populating a simple form, using string variable types for textfields, radiobuttons, dropdowns and checkboxes
  • Populating a complex form, using array variable types for checkbox arrays and multi-list boxes
  • Populating a hierarchical form, using hierarchical JSON data

View the jQuery Populate Demo here.

Download

JavaScript

PHP

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

离散数学及其应用(原书第6版·本科教学版)

离散数学及其应用(原书第6版·本科教学版)

[美] Kenneth H. Rosen / 袁崇义、屈婉玲、张桂芸 / 机械工业出版社 / 2011-11 / 49.00元

《离散数学及其应用》一书是介绍离散数学理论和方法的经典教材,已经成为采用率最高的离散数学教材,仅在美国就被600多所高校用作教材,并获得了极大的成功。第6版在前5版的基础上做了大量的改进,使其成为更有效的教学工具。 本书基于该书第6版进行改编,保留了国内离散数学课程涉及的基本内容,更加适合作为国内高校计算机及相关专业本科生的离散数学课程教材。本书的具体改编情况如下: · 补充了关于范式......一起来看看 《离散数学及其应用(原书第6版·本科教学版)》 这本书的介绍吧!

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

HTML 编码/解码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具