Results 1 to 4 of 4
  1. #1
    macs_80 is offline Member
    Join Date
    Jun 2010
    Posts
    2
    Rep Power
    0

    Default Form Parameter Undefined

    Hi everybody!

    I've got a problem with a jsp, which contains a form.

    This page has always worked fine, It's the first time I try to midify it, but when I try to go on that page I get this error (using firebug to identify it):

    document.prova.flag is undefined

    where prova il form and flag is a parameter.

    The error gets raised fro a javascript that tries to set the parameter value:
    (I just commented the rest to isolate the possible cause)

    Java Code:
    <SCRIPT LANGUAGE="JavaScript">
    function view(form){
     document.prova.flag.value = 'GC';
     //document.all.linkPageDGC.style.display = 'none';
     //document.all.NOlinkPageDGC.style.display = '';
    //if((abilitazioniUtente.getInserimentoGiroconto()).equals("true")){
     //document.all.linkPageGC.style.display = '';
     //document.all.NOlinkPageGC.style.display = 'none';
    // }
    if(GC != null && false){
     //document.all.linkPageDGC.style.display = '';
     //document.all.NOlinkPageDGC.style.display = 'none';
     //document.all.linkPageGC.style.display = 'none';
     //document.all.NOlinkPageGC.style.display = '';
     document.prova.flag.value = 'GC';
     document.prova.flagView.value = 'nuovoGC';
     }
    }
    Following the Form and parameter:

    XML Code:
    <form name="prova">
    <input type='hidden' name='flag' value=''>
    Thanks a lot

    Max

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    That's an html/javascript question which has nothing to do with Java.
    Ask in a relevant forum.

  3. #3
    arun9683 is offline Member
    Join Date
    Jun 2010
    Location
    Bangalore,India
    Posts
    70
    Rep Power
    0

    Default

    add id to the hidden form element
    <input type='hidden' id='flag' name='flag' value=''>

    And

    in the javascript instead of document.prova.flag.value
    use document.getElementById('flag').value

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Replies: 2
    Last Post: 05-08-2010, 12:02 AM
  2. Undefined attribute name
    By Dieter in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 05-03-2010, 11:44 AM
  3. Replies: 0
    Last Post: 05-27-2009, 05:39 PM
  4. Replies: 5
    Last Post: 04-06-2009, 11:10 PM
  5. Replies: 2
    Last Post: 07-03-2008, 02:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •