I am using this java script code to show and hide a prompt box in
Cognos reportnet , it is working fine in IE , but when it comes to
Firefox then it does not becomes activated . Even if I click any button
in same prompt , the next prompt does not show up.
It is not returning any error to me but its simply not working.So if
the code can be modified so that it works fine with Firefox.
sowencheung@gmail.com wrote:[color=blue]
> i don't know what error u r encountering
> did u install FireBug to debug ur js in FF?
>
> i think u will have better feedback with that tool
>
>
> Coder wrote:[color=green]
> > Hi I have the following code in java script, it is not giving proper
> > output in FIREFOX but running fine in IE... can anybody help me out to
> > make this run in FIREFOX .
> >
> >
> > <script language="JavaScript">
> > var cntlName;
> > var eleTarget = document.getElementById('hiding');
> >
> > function showOrHide(){
> > alert ("hi");
> > var eleSource = event.srcElement;
> >
> > if (event.srcElement) {
> > //for IE
> > var eleSource = event.srcElement;
> > }
> > else {
> > //for Firefox
> > var eleSource = event.target;
> > }
> >
> > if (eleSource.value == 'MGRPAY') {
> > //for IE
> > eleTarget.style.display = 'block';
> > }
> > else {
> > eleTarget.style.display = 'none';
> > }
> > }
> >
> > for(var i=0; i<preProcessControlArray.length; i++){
> > cntlName = eval(preProcessControlArray[i]);
> > if (cntlName.m_oSubmit.name.toLowerCase() == 'p_par_rad_role'){
> > if (cntlName.m_oForm.length) {
> > for( var j=0; j<cntlName.m_oForm.length; j++ ){
> > if (j == 0) {
> > cntlName.m_oForm[j].focus();
> > cntlName.m_oForm[j].click();
> > if (cntlName.m_oForm[j].value == 'MGRPAY') {
> > eleTarget.style.display = 'block';
> > }
> > else {
> > eleTarget.style.display = 'none';
> > }
> > }
> > //For IE
> > if(cntlName.m_oForm[j].attachEvent)
> > cntlName.m_oForm[j].attachEvent('onpropertychange',
> > showOrHide);
> > //for firefox
> > else
> > cntlName.m_oForm[j].addEventListener('onchange',
> > showOrHide,false);
> > }
> > }
> > else {
> > cntlName.m_oForm.focus();
> > cntlName.m_oForm.click();
> > if (cntlName.m_oForm.value == 'MGRPAY') {
> > eleTarget.style.display = 'block';
> > }
> > else {
> > eleTarget.style.display = 'none';
> > }
> > }
> > }
> > }
> > </script>[/color][/color]