PDA

View Full Version : function in javascript wasn't called


nancy_lee
11-20-2002, 06:59 PM
I have coded the following script with the onClick function to call 2 functions :


action.append('<td class="bgMenu"><div class="LinkOnBgMenu" style="text-align:center;padding:2px;padding-bottom:4px;"> <A href="'+db.getFilePath().replace("\\","/")+'/(changeflag)?openAgent&taskID='+taskID+'&login" onClick="validateAndSubmit();SECONDFUNCTION(-2)" class="LinkColorOnBgMenu">go to products</a> </div></td><td width="20"> </td>');

The first one validateandsubmit worked but the second one
has an error message :


document.getElementById("approveFlag").value is Null or not an object ;


Below is the script for SECONDFUNCTION()

function SECONDFUNCTION(flag) {

var flag1 = flag;


document.getElementById("approveFlag").value = flag1;

alert ("***** flag"+flag1);
alert (document.getElementById("approveFlag").value);

}







Please help!
Thanks

Roy Sinclair
11-20-2002, 07:59 PM
What it's telling you is that you don't have anything on your web page with an ID of approveFlag. It's not a problem with how you're calling the function.

nancy_lee
11-20-2002, 08:10 PM
I got it , thanks