Jquery Course

Examples Fancy-Fields

Fancy Fields is a jQuery plugin to create Forms with a Custom Look. It is useful for web designers, it can create Checkbox and Radio buttons, Select drop-down lists, text and textarea fields with a nice design that you can style it in CSS.


• To DOWNLOAD this script, click: (470 KB) - version: 1.2.

Installation

1. First, to use this plugin, copy the "jqfields" folder with all its files on your server. The script comes with jQuery 1.10.2 ("jquery.js" in "jqfields/" directory).
2. Include these files in the <head> zone of your web page: Fancy-Fields css styles, jQuery library, the Fancy-Fields jQuery plugin.
<script src="jqfields/jquery.js"></script>

<!-- jquery-ui is necessary only if you want to use custom scroll-bar for select drop-down lists -->
<script src="jqfields/jquery-ui.js" type="text/javascript"></script>

<link href="jqfields/fancyfields.css" rel="stylesheet" type="text/css" />
<script src="jqfields/fancyfields-1.2.min.js" type="text/javascript"></script>

"fancyfields.css" is the basic theme. There are also other predefined themes in the "jqfields" folder: "fancyfields2.css", "fancyfields_blue.css", "fancyfields_green.css" ... If you want one of these themes, just replace the "fancyfields.css" whit the name of that file.

3. Then, add the following code to the document ready.
- Every form element in a div with ID "myForm" will be transformed to a styled form element.
$('#myForm').fancyfields();
If you want to apply Fancy-Fields only to a specified form element, for example to a <select> element, add an ID to that <select> tag and write this code:
$('#id_select').fancyfields();
You can also create dinamycally select drop-down lists, by using this formula:
// defines an  array of arrays with 2 ["text","value"] values or 1 ["text and value"] value
var listOptions = [["select","0"],["option1", "val1"],["option2", "val2"], ["optionval3"]];
$("#id_container").setOptions(listOptions);

// or change the options of a Select list
$("#id_select").setOptions(listOptions);
• Fancy-Fields has a set of options to work with the custom form fields, to enable /disable form elements, custom scroll bar for select box, get the selected /checked value, and other useful options and events. Details and code examples are in the "Readme.html" file, in the archive with this script.

Examples Fancy-Fields

Checkbox:




Radio:


Select:

Select with icons:

Select with custom scroll bar:

Text fields:








• The Fancy fields home page is at: http://www.jqfancyfields.com/

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag defines the clickable areas inside the image map?
<map> <img> <area>
<img src="image.jpg" usemap="#map1">
<map name="map1">
  <area shape="rect" coords="9, 120, 56, 149" href="#">
  <area shape="rect" coords="100, 200, 156, 249" href="#">
</map>
Which CSS property defines what is done if the content in a box is too big for its defined space?
display overflow position
#id {
  overflow: auto;
}
Click on the event which is triggered when the mouse is positioned over an object.
onclick onmouseover onmouseout
document.getElementById("id").onmouseover = function(){
  document.write("Have Good Life");
}
Indicate the PHP variable that contains data added in URL address after the "?" character.
$_SESSION $_GET $_POST
if(isset($_GET["id"])) {
  echo $_GET["id"];
}
Fancy-Fields Custom Forms Look

Last accessed pages

  1. Creating Mask Layers in Flash (5062)
  2. PhpSpreadsheet - Read, Write Excel and LibreOffice Calc files (26002)
  3. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (137554)
  4. The Mastery of Love (6766)
  5. Add data from form in text file in JSON format (15671)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (243)
  2. Read Excel file data in PHP - PhpExcelReader (84)
  3. The Four Agreements (73)
  4. PHP Unzipper - Extract Zip, Rar Archives (72)
  5. The Mastery of Love (63)
Chat
Chat or leave a message for the other users
Full screenInchide