Results 1 to 8 of 8

Thread: how to i get html codes to run onclick of a button?

  1. #1
    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.

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    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


    <A href="#" onclick="RunProgram('Location of File');return false">

  3. #3
    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..!

  4. #4
    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.

  5. #5
    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

  6. #6
    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>

  7. #7
    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...!

  8. #8
    Join Date
    Oct 2005
    Posts
    2,393

    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.

Similar Threads

  1. How to write HTML codes for pictures
    By softte in forum Software Development
    Replies: 5
    Last Post: 01-10-2010, 12:45 AM
  2. CSS Button onclick event href="#" onclick="
    By Cornnelius in forum Software Development
    Replies: 6
    Last Post: 14-05-2010, 11:20 PM
  3. A Href And OnClick Button
    By Endowed in forum Software Development
    Replies: 5
    Last Post: 11-05-2010, 10:24 PM
  4. HTML Color Codes
    By Sonia G in forum Software Development
    Replies: 4
    Last Post: 27-03-2010, 05:58 PM
  5. HTML/JavaScript/onclick
    By KADEEM in forum Software Development
    Replies: 4
    Last Post: 03-11-2009, 06:37 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,055,054.60632 seconds with 16 queries