Checkbox not opening dialog

Checkbox not opening dialog

I have a problem...(relative newbie here) I want a dialog to open when i check a checkbox
My code is:

  1. <input type="checkbox" id="actionneeded" /><label for="actionneed">Action Needed</label>
  2. <div id="dialog-form">
  3. <p>Test Dialog</p>
  4. </div>
  5. <script type="text/javascript">
  6. $(document).ready(function() {
  7. var dialog = $("#dialog-form").dialog({
  8. autoOpen: false,
  9. height: 300,
  10. width: 350,
  11. modal: true
  12. });

  13. $("#actionneeded").click(function(e) {
  14. dialog.dialog('open');
  15. e.preventDefault();
  16. });
  17. });
  18. </script>
but when i load the page I get a TypeError: $(...).dialog is not a function message from firefox
and the line number points to the "modal:true" line

What am i doing wrong
any and all help as always will be muchly appreciated...

4