I'm just getting started with jQuery.
I just made a form with a datepicker, which works fine. But I can't get the widget button to work.
I downloaded a theme and I'm importing the files as you can see in the code below. Do I have to download anything else to get the button to work? What's wrong?
My code looks like this:
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Form test</title>
- <link href="_css/main2.css" rel="stylesheet" type="text/css" media="screen, projection" />
- <link href="_css/trontastic/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css" media="screen, projection" />
- <script type="text/javascript" src="_scripts/jquery-1.4.2.min.js"></script>
- <script type="text/javascript" src="_scripts/jquery-ui-1.7.2.custom.min.js"></script>
- <script type="text/javascript">
- // Date box function
- $(function() {
- $('#date').datepicker({
- changeMonth: true,
- changeYear: true
- });
- });
-
- // Button
- $(function() {
- $("button, input:submit, a", ".demo").button();
-
- $("a", ".demo").click(function() { return false; });
- });
- </script>
- </head>
- <body>
- <div id="wrapper">
- <form action="#" method="post" name="bla" target="_self">
- <p>
- <label for="date">Date: </label><input type="text" id="date" />
- </p>
- <p>
- <input type="submit" value="A submit button">
- </p>
- </form>
- </div>
- </body>
- </html>