Call Java onclick function from Addoutput

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chrismicro
Forum Newbie
Posts: 21
Joined: Fri Nov 12, 2010 7:03 am

Call Java onclick function from Addoutput

Post 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?
Last edited by Benjamin on Sat Dec 11, 2010 10:01 am, edited 1 time in total.
Reason: Added [syntax=php] tags.
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

Re: Call Java onclick function from Addoutput

Post by internet-solution »

remove the comment tags in javascript
[syntax]<!--[/syntax]
and
[syntax]//-->[/syntax]

Also note that "Java" and "JavaScript" are not the same.
Last edited by internet-solution on Sat Dec 11, 2010 4:16 am, edited 1 time in total.
chrismicro
Forum Newbie
Posts: 21
Joined: Fri Nov 12, 2010 7:03 am

Re: Call Java onclick function from Addoutput

Post 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");
	}
Last edited by Benjamin on Sat Dec 11, 2010 10:02 am, edited 1 time in total.
Reason: Added [syntax=php] tags.
Post Reply