469,315 Members | 1,573 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,315 developers. It's quick & easy.

undefined variable in function

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
1 1173
gits
5,390 Expert Mod 4TB
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.

Similar topics

6 posts views Thread by Will | last post: by
10 posts views Thread by Sharon | last post: by
4 posts views Thread by Chris Beall | last post: by
49 posts views Thread by matty | last post: by
17 posts views Thread by yb | last post: by
9 posts views Thread by arundelo | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.