Skip to content

Instantly share code, notes, and snippets.

@daffl
Created August 5, 2011 02:51
Show Gist options
  • Save daffl/1126835 to your computer and use it in GitHub Desktop.
Save daffl/1126835 to your computer and use it in GitHub Desktop.
Simple complete jQuery dform example
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> KISS, based on fiddle example </title>
<script type='text/javascript' src='jquery-1.5.2.js'></script>
<script type="text/javascript" src="jquery-ui.js"></script>
<script type='text/javascript' src="jquery.dform-0.1.3.min.js"></
script>
<link rel="stylesheet" type="text/css" href="jquery-
ui-1.8.4.custom.css">
<link rel="stylesheet" type="text/css" href="main.css">
<script type='text/javascript'>
$(window).load(function(){
$("#myform").buildForm({
"action" : "index.html",
"method" : "get",
"elements" :
[
{
"type" : "p",
"html" : "You must login"
},
{
"name" : "username",
"id" : "txt-username",
"caption" : "Username",
"type" : "text",
"placeholder" : "E.g. u...@example.com"
},
{
"name" : "password",
"caption" : "Password",
"type" : "password"
},
{
"type" : "submit",
"value" : "Login"
}
]
});
});
</script>
</head>
<body>
<form id="myform"></form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment