Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 04-05-2009
Member
 
Join Date: May 2009
Posts: 2
question how to i get html codes to run onclick of a button?

Ok im working on my website its going to be a fairly good gamming site when im done. Right now i am working on having the games in a pop up. I have the pop up ready but it runs right when the page loads, i want it to run when you click on a button that says "play now". Can someone help me? It should be a code like this: set to onclick run then a place that i can paste the html code into it so it will run when you click on the button.
Reply With Quote
  #2  
Old 04-05-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: how to i get html codes to run onclick of a button?

Hello , You Can Check this Thread For more info Install Using OnClick Function

You Can This Code also


Quote:
<A href="#" onclick="RunProgram('Location of File');return false">
Reply With Quote
  #3  
Old 04-05-2009
Member
 
Join Date: Jan 2009
Posts: 1,738
Re: how to i get html codes to run onclick of a button?

Hey!
If you are familiar with Visual Basic you can use Active X control to use this function of yours... Well i learnt it in College some 2 years back..!
Reply With Quote
  #4  
Old 04-05-2009
Member
 
Join Date: May 2008
Posts: 685
Re: how to i get html codes to run onclick of a button?

Your problem is here: Create php alert pop ups using javascript.

You might have given the popup() in the body tag, something like this:

Code:
<body onload="popup()">
Just remove it and give it somewhere else. Since you want it on the "play now" button, you can definitely use onclick function.
Reply With Quote
  #5  
Old 05-05-2009
Member
 
Join Date: May 2009
Posts: 2
Re: how to i get html codes to run onclick of a button?

no what im looking for is a html script that you click on a button and a html popup comes up
Reply With Quote
  #6  
Old 05-05-2009
Member
 
Join Date: May 2008
Posts: 685
Re: how to i get html codes to run onclick of a button?

Then this must be what you want:

Code:
<button onclick="html_link_goes_here">Play Now</button>
Reply With Quote
  #7  
Old 05-05-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: how to i get html codes to run onclick of a button?

Example HTML Popup Window Code:

Code:
<script type="text/javascript">
// Popup window code
function newPopup(url) {
	popupWindow = window.open(
		url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
</script>
<a href="javascript:newPopup('http://forums.techarena.in/');">Open a popup window</a>
This example uses JavaScript code for the popup window. You can also open a new window using HTML code without JavaScript (although using the HTML method, you aren't able to specify how the window will look). To open a new window using HTML.

You can use the HTML code on this page to force a link to open in a new window.

Code:
<a href="http://forums.techarena.in/" target="_blank">HTML Help</a>

May this Help you...!
Reply With Quote
  #8  
Old 05-05-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: how to i get html codes to run onclick of a button?

onClick gives the script to run when the user clicks on the input. Here, you want html pop-up. So simply give the link in the onClick syntax you want to popup. The syntax for onClick is already mentioned before. onClick can return a value to possibly cancel the action the button would normally perform.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "how to i get html codes to run onclick of a button?"
Thread Thread Starter Forum Replies Last Post
How to write HTML codes for pictures softte Software Development 5 01-10-2010 12:45 AM
CSS Button onclick event href="#" onclick=" Cornnelius Software Development 6 14-05-2010 11:20 PM
A Href And OnClick Button Endowed Software Development 5 11-05-2010 10:24 PM
HTML Color Codes Sonia G Software Development 4 27-03-2010 05:58 PM
HTML/JavaScript/onclick KADEEM Software Development 4 03-11-2009 06:37 PM


All times are GMT +5.5. The time now is 06:03 PM.