By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,686 Members | 1,840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,686 IT Pros & Developers. It's quick & easy.

undefined variable in function

P: 1
Hi guys,

I need some help. here is the code


Expand|Select|Wrap|Line Numbers
  1. <script language="javascript" type="text/javascript">
  2.                 function submitbutton(pressbutton) {
  3.                         var form = document.adminForm;
  4.                         if (pressbutton == 'cancelcatg') {
  5.                                 submitform( pressbutton );
  6.                                 return;
  7.                         }
  8.  
  9.                         // do field validation
  10.                         try {
  11.                         document.adminForm.onsubmit();
  12.                         }
  13.                         catch(e){}
  14.                         if (form.name.value == ""){
  15.                                 alert( "Category must have a title" );
  16.                         } else {
  17.                                 wp_prepare_submission(description);                                submitform( pressbutton );
  18.                         }
  19.                 }
  20.                 </script>

i am getting a 'description' undefined error from this. HELP!!! :( I can't see what is wrong here.

stephanie
Oct 7 '07 #1
Share this Question
Share on Google+
1 Reply


gits
Expert Mod 5K+
P: 5,390
hi ...

welcome to TSDN ...

in line:

Expand|Select|Wrap|Line Numbers
  1. wp_prepare_submission(description);
there is description used ... what should it be? in your entire function i cannot see anything about it ... could you post more code ... may be its a global variable? or what should 'description' be?

kind regards
Oct 8 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.