Example #1
0
<?php

FORM_UTIL::create()->checkbox("country[only_name]", "Only include country names")->checkbox("country[name]", "Include country name")->checkbox("country[code]", "Include country codes")->checkbox("country[key_code]", "Use the country code as the key in the countries array")->checkbox("country[regions]", "Include regions")->checkbox("regions[lat]", "Include region latitude")->checkbox("regions[lng]", "Include region longitude")->checkbox("regions[value_keys]", "Use the key names in the region")->button("generate", "Generate Countries/Regions", array("class" => "generate"))->render();
?>

<p id="generated" class="p20"></p>


<script>

	$(function() {

		$(".generate").click(function() {

			var form = $("#form-country").serializeArray();
			form.push({ name: "action", value: $(this).attr("name") });

			$.post("/generate/docountry",form,function(response) {
				if(response.has_success) {
					$("#generated").text(response.data.generated);
					FF.msg.success("Successfully generated");				
				} else
					FF.msg.error(response.errors);

			});
		});	

	});
</script>
Example #2
0
<h1>Complex Model</h1>
<form id="form-cmodel">

	<div class="fl w300 pr20">
		<h3>C-Models</h3>
		<?php 
echo HTML_UTIL::dropdown("cmodel", $cmodels, $model, array("size" => 30), count($cmodels));
?>
	</div>
	<div>
		<h3>Addons</h3>

		<?php 
$db_table = FORM_UTIL::create()->checkboxes("types", "Type", array("image" => "Image"))->custom(HTML_UTIL::h4("Image"), array("class" => "row-image"))->input("image[name]", "Name", "", array("placeholder" => "ie. avatar", "class" => "row-image w400"))->input("image[sizes]", "Sizes", "tiny:s25,small:s100,medium:s300,large:600,actual", array("placeholder" => "ie. tiny:s25,small:s100,medium:s300,large:600,actual", "class" => "row-image w400"))->input("image[path]", "Path", "", array("placeholder" => "ie. us/av", "class" => "row-image w400"));
?>
	
		<?php 
echo $db_table->button("generate", "Generate", array("type" => "button"))->render();
?>
	</div>

</form>

<script>

	
	$(function() {
		$(".row-image").parents("tr").hide();

		$("input[name='types[]']").click(function() {
			if($(this).is(":checked"))