undefined variable in function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ssanchez
    New Member
    • Oct 2007
    • 1

    undefined variable in function

    Hi guys,

    I need some help. here is the code


    [CODE=javascript]<script language="javas cript" type="text/javascript">
    function submitbutton(pr essbutton) {
    var form = document.adminF orm;
    if (pressbutton == 'cancelcatg') {
    submitform( pressbutton );
    return;
    }

    // do field validation
    try {
    document.adminF orm.onsubmit();
    }
    catch(e){}
    if (form.name.valu e == ""){
    alert( "Category must have a title" );
    } else {
    wp_prepare_subm ission(descript ion); submitform( pressbutton );
    }
    }
    </script>[/CODE]


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

    stephanie
    Last edited by gits; Oct 8 '07, 08:27 AM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    hi ...

    welcome to TSDN ...

    in line:

    [CODE=javascript]wp_prepare_subm ission(descript ion);[/CODE]
    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

    Comment

    Working...