Page 1 of 1

Call Java onclick function from Addoutput

Posted: Sat Dec 11, 2010 3:54 am
by chrismicro
This is for making a 400 x 200 window open with a specified page I need from the output of $hidehex4 = False ( utilizing the else statement )

Here is my if statement:

Code: Select all

if ($hideHex4) {
	  $m1->AddOutput("<input type='hidden' id='Hex4' value='".$hex4."'>\n");  
	}
 else {
	  $m1->AddOutput("<input type='text' id='Hex4' value='".$hex4."'> &nbsp;&nbsp;	 
<img src='aud.png' width='35' height='30' onclick='MM_openBrWindow('http://xx.xx.xx.xx/xxxxxxxx/audiouploaderk.php?userid=7777','audio','resizable=yes,width=400,height=200')'/>\n");
	}
Here is my java function

Code: Select all

 <script type='text/javascript'>
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//--></script>

I utilize the javascript in the php page between ?> and <?PHP yet it will not call the function how can I resolve this?

Re: Call Java onclick function from Addoutput

Posted: Sat Dec 11, 2010 4:14 am
by internet-solution
remove the comment tags in javascript
[syntax]<!--[/syntax]
and
[syntax]//-->[/syntax]

Also note that "Java" and "JavaScript" are not the same.

Re: Call Java onclick function from Addoutput

Posted: Sat Dec 11, 2010 4:15 am
by chrismicro
I figured it out:

Code: Select all

if ($hideHex4) {
	  $m1->AddOutput("<input type='hidden' id='Hex4' value='".$hex4."'>\n");  
	} else {
	  $m1->AddOutput("<input type='text' id='Hex4' value='".$hex4."'> &nbsp;&nbsp;	 
<img src='aud.png' width='35' height='30' onclick=\"javascript:window.open('http://xx.xx.xxx.xxx/xxxxxxl/audiouploaderk.php?userid=63','audio','resizable=yes,width=400,height=200')\"/>\n");
	}