Search Results

Search found 2764 results on 111 pages for 'onclick'.

Page 12/111 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • jQuery - add onclick to TR

    - by Guus
    I use Richfaces and one of the rich:dataTable generates this html: <form id="scheduleForm"> <table id="scheduleForm:rowList"> <tr> <td></td> </tr> </table> </form> I want to act on a click on a TR for this table. How can I do this? The following also works for other tables on the page and I get the alert() for the other rows as well, and I don't want that. jQuery('#scheduleForm:rowList tr').click(function(event) { alert(1); });

    Read the article

  • creating button and calling function on its onclick event using javascript

    - by Deven
    hello friends sorry for previous question actuly my question is i am having one button called btn[0] which is allready on browser when it is loaded when i click on btn[0] it will create another button element called btn[1] now btn[0]'s click event is disabled and when i click on btn[1] it will also generate another button which called btn[2] when i click on btn[2] it will generate another btn called btn[3] and so on

    Read the article

  • Hide table row onclick using jquery

    - by John
    I have a bunch of table rows such as: <tr> <td>cell1</td> <td>cell2</td> <td><a href="action.php">cell3</a></td> </tr> <tr class="notes_row"> <td colspan="6"> <ul class="message warning no-margin" id="notes_box"> <li>Notes here</li> </ul> </td> </tr> <tr> <td>cell1</td> <td>cell2</td> <td><a href="action.php">cell3</a></td> </tr> The class="notes_row" is only there if notes are present for the row above it. How can I hide the tr and if its there the tr with the notes_row class below it without affecting the other rows using jquery? So if someone clicked cell3 the tr that link is in is hidden then if there is a notes table row below it, it hides that as well.

    Read the article

  • AddClass onClick won't work

    - by QTaylor
    I'm having some problems getting some simple jQuery to work; I'm trying to add a class called fadeInLeft to my body element on click. Here's the code: $('.contact-button').click(function() { $('body').addClass('fadeInLeft') }); HTML (from comment left by OP, below): <div id="contact" class="bounceInRight animated four"> <a href="#" class="contact-button"> Say Hello </a> </div><!--End of contact--> contact-button is the class of the link, fadeInLeft is the class I want to add when the link is clicked. Any idea why this would not work ?

    Read the article

  • Tic Tac Toe Winner in Javascript and html [closed]

    - by Yehuda G
    I am writing a tic tac toe game using html, css, and JavaScript. I have my JavaScript in an external .js file being referenced into the .html file. Within the .js file, I have a function called playerMove, which allows the player to make his/her move and switches between player 'x' and 'o'. What I am trying to do is determine the winner. Here is what I have: each square, when onclick(this), references playerMove(piece). After each move is made, I want to run an if statement to check for the winner, but am unsure if the parameters would include a reference to 'piece' or a,b, and c. Any suggestions would be greatly appreciated. Javascript: var turn = 0; a = document.getElementById("topLeftSquare").innerHTML; b = document.getElementById("topMiddleSquare").innerHTML; c = document.getElementById("topRightSquare").innerHTML; function playerMove(piece) { var win; if(piece.innerHTML != 'X' && piece.innerHTML != 'O'){ if(turn % 2 == 0){ document.getElementById('playerDisplay').innerHTML= "X Plays " + printEquation(1); piece.innerHTML = 'X'; window.setInterval("X", 10000) piece.style.color = "red"; if(piece.innerHTML == 'X') window.alert("X WINS!"); } else { document.getElementById('playerDisplay').innerHTML= "O Plays " + printEquation(1); piece.innerHTML = 'O'; piece.style.color = "brown"; } turn+=1; } html: <div id="board"> <div class="topLeftSquare" onclick="playerMove(this)"> </div> <div class="topMiddleSquare" onclick="playerMove(this)"> </div> <div class="topRightSquare" onclick="playerMove(this)"> </div> <div class="middleLeftSquare" onclick="playerMove(this)"> </div> <div class="middleSquare" onclick="playerMove(this)"> </div> <div class="middleRightSquare" onclick="playerMove(this)"> </div> <div class="bottomLeftSquare" onclick="playerMove(this)"> </div> <div class="bottomMiddleSquare" onclick="playerMove(this)"> </div> <div class="bottomRightSquare" onclick="playerMove(this)"> </div> </div>

    Read the article

  • Why is FBJS dropping my 'onclick' attribute from this input element?

    - by Chris Barnhill
    When I include an 'onClick' attribute in setInnerXTHML() like this: var innerHtml = '<span>Build Track: Select a city where track building should begin'+ '<div id="action-end">'+ '<form>'+ '<input type="button" value="End Track Building" id="next-phase" onClick="moveTrainAuto();" />'+ '</form>'+ '</div></span>'; actionPrompt.setInnerXHTML(innerHtml); var btn = document.getElementById('next-phase'); btn.addEventListener('click', 'moveTrainAuto'); The 'onClick' gets dropped. I know this from inspecting the element with Firebug. This is what it reveals: <input id="app148184604666_next-phase" type="button" value="End Track Building"/> Here is the function called for onClick: function moveTrainAuto(evt) { debugger; ajax = new Ajax(); ajax.responseType = Ajax.JSON; ajax.ondone = function(data) { debugger; if(data.code == 'UNLOAD_CARGO') { unloadCargo(); } else if (data.code == 'MOVE_TRAIN_AUTO') { moveTrainAuto(); } else if (data.code == 'TURN_END') { turnEnd(); } else { /* handle error */ } } ajax.post(baseURL + '/turn/move-trains-auto'); } As you can see, I've tried both 'onClick' and 'addEventListener'. Neither works. Any ideas?

    Read the article

  • Selenium: How to click buttons that use onclick window.location?

    - by Andrew
    I have a button (outside of a form) that redirects to another page using the onclick attribute that calls window.location to redirect the user to another page. This time I can't change the HTML. I am using Safari 4 for testing. How can I click a button that uses the onclick attribute and window.location to redirect using Safari 4 and Selenium RC PHPUnit Extension? Here's my HTML: <input type="button" onclick="window.location='/registrations/new'" value="Start a new registration" id="create">

    Read the article

  • How to set an onClick attribute that would load dynamic content?

    - by konzepz
    This code is suppose to add an onClick event to each of the a elements, so that clicking on the element would load the content of the page dynamically into a DIV. Now, I got this far - It will add the onClick event, but how can I load the dynamic content? $(document.body).ready(function () { $("li.cat-item a").each(function (i) { this.setAttribute('onclick','alert("[load content dynamically into #preview]")'); }); }); Thank you.

    Read the article

  • How to hook onclick event for each cell in a table in Javascript?

    - by MartyIX
    I was thinking if there's a better solution for adding onclick handler to each cell in a table than this approach: http://stackoverflow.com/questions/1207939/adding-an-onclick-event-to-a-table-row Better in the way that I wouldn't need to set "cell.onclick = function" for each cell. I just need to get the coordinations of a cell where user clicked. Thanks!

    Read the article

  • Append an onClick event to an anchor tag using jquery?

    - by M.Woodard
    I am trying to add an onClick event to an anchor tag ... Previously i had ... <a href="somlink.html" onClick="pageTracker._link(this.href); return false;"> But i am trying to avoid the inline onClick event because it interferes with another script.. So using jQuery i am trying the following code ... <script> $(document).ready(function() { $('a#tracked').attr('onClick').click(function() {window.onbeforeunload = null; pageTracker._link(this.href); return false; }); }); </script> with the html like so <a id="tracked" href="something.html"> So my question is should this be working, and if not what would be the best solution?

    Read the article

  • #include file vs iframe or is there a better way

    - by Laurence Burke
    ok simple question about including large mostly static html and asp.net code I am using as of right now #include and I was wondering if iframes would be a better way of handling what I wish to do or is there a better way to do it. here is the current way i'm handling the includes default.aspx <head id="YafHead" runat="server"> <meta id="YafMetaDescription" runat="server" name="description" content="Yet Another Forum.NET -- A bulletin board system written in ASP.NET" /> <meta id="YafMetaKeywords" runat="server" name="keywords" content="Yet Another Forum.net, Forum, ASP.NET, BB, Bulletin Board, opensource" /> <title>Forums</title> <style type="text/css"> .sbutton { background-color:#361800; border:medium none; border-collapse:collapse; color:#FFFFFF; font-family:Tahoma,Arial,Helvetica; font-size:10px; font-weight:bold; vertical-align:middle; } </style> <link href="images/favicon.ico" type="image/ico" rel="shortcut icon" /> <link rel="stylesheet" href="navTopStyle.css" type="text/css" media="screen" /> </head> <body style="margin: 0"> <form id="form1" runat="server" enctype="multipart/form-data"> <table align="center" style="background-color: #ffffff" cellpadding="0" cellspacing="0" width="790px"> <tr> <td> <!--#include file="CComHeader.html"--> </td> </tr> <tr> <td> <YAF:Forum runat="server" ID="forum"></YAF:Forum> </td> </tr> </table> </form> </body> </html> CComHeader.html <table cellpadding="0" cellspacing="0" width="790px"> <tr> <td align="left"> <img src="images/smokechair.jpg" alt="Cigar.com" /><img src="images/cigarcomTitle.gif" alt="Cigar.com" /> </td> <td align="right"> <table width="310px" height="73px" cellpadding="0" cellspacing="0" style="padding-right: 6px"> <tr> <td width="109px" class="welcome" align="left"> Welcome to Cigar.com </td> <td width="195px" class="welcome" align="left"> <div runat="server" id="divUser"> <table cellpadding="0" cellspacing="0" align="right"> <tr> <td width="126px" align="left"> <asp:Label ID="lblUserName" CssClass="welcome" runat="server"></asp:Label></td> <td width="65px" align="left"> <a href="http://www.cigar.com/cs/languages/en-US/docs/faq.aspx">Help</a></td> </tr> </table> </div> <div runat="server" id="divGuest"> <a href="OutsideLogin.aspx">Sign In</a> | <a href="OutsideLogin.aspx">Join</a> | <a href="http://www.cigar.com/cs/languages/en-US/docs/faq.aspx">Help</a> </div> </td> </tr> <tr> <td colspan="2"> <table cellpadding="0" cellspacing="0" > <tr> <td width="234px" align="right"> <asp:DropDownList ID="ddlCriteria" runat="server"> <asp:ListItem>Posts</asp:ListItem> <asp:ListItem>Posted By</asp:ListItem> </asp:DropDownList> <asp:TextBox Width="120px" ID="txtSearch" runat="server"></asp:TextBox> </td> <td width="70px" align="center"> <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="sbutton" OnClick="btnSearch_Click" /> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td colspan="2"> <!--#include file="commonTabBar.html" --> </td> </tr> </table> commonTabBar.html <%-- CommonTabBar firebugged from Cigar.com--%> <div class="CommonTabBar"> <script language="javascript"> function tabOver(e) { if (e.className != 'CommonSimpleTabStripSelectedTab') e.className = 'CommonSimpleTabStripTabHover'; } function tabOut(e) { if (e.className != 'CommonSimpleTabStripSelectedTab') e.className = 'CommonSimpleTabStripTab'; } function tabOverSub(e) { if (e.className != 'CommonSimpleTabStripSelectedTabSub') e.className = 'CommonSimpleTabStripTabHoverSub'; } function tabOutSub(e) { if (e.className != 'CommonSimpleTabStripSelectedTabSub') e.className = 'CommonSimpleTabStripTabSub'; } </script> <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr valign="middle"> <td class="CommonSimpleTabStripTab" style="padding: 0px"> &nbsp; </td> <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this);" onmouseout="tabOut(this);" onclick="window.location = 'http://www.cigar.com/index.asp'"> <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px; padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/index.asp"> Home</a> </td> <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this); document.getElementById('ComDropDown2').style.display = 'inline';" onmouseout="tabOut(this); document.getElementById('ComDropDown2').style.display = 'none';"> <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px; padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/cigars/index.asp"> Cigars</a> <div id="ComDropDown2" style="border: 1px solid rgb(71, 42, 24); margin: 28px 0px 0px; display: none; background-color: rgb(235, 230, 208); color: rgb(71, 42, 24); position: absolute; float: left; z-index: 200;" onmouseover="document.getElementById('ComDropDown2').style.display = 'inline';" onmouseout="document.getElementById('ComDropDown2').style.display = 'none';"> <ul style="margin: 0px; padding: 0px; width: 100px;"> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cigars/index.asp'"><a href="http://www.cigar.com/cigars/index.asp" style="line-height: 25px; color: rgb(71, 42, 24);" id="BrandsLink">Brands </a> </li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cigars/privatelabel.asp?brand=419'"> <a href="http://www.cigar.com/cigars/privatelabel.asp?brand=419" style="line-height: 25px; color: rgb(71, 42, 24);" id="SamplersLink">Aging Room </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cigars/samplers.asp'"><a href="http://www.cigar.com/cigars/samplers.asp" style="line-height: 25px; color: rgb(71, 42, 24);" id="SamplersLink">Samplers </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cigars/suggestions.asp'"><a href="http://www.cigar.com/cigars/suggestions.asp" style="line-height: 25px; color: rgb(71, 42, 24);" id="SuggestionsLink">Suggestions </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/DailyDeal/ccCigarDeals.asp'"><a href="http://www.cigar.com/DailyDeal/ccCigarDeals.asp" style="line-height: 25px; color: rgb(71, 42, 24);" id="SuggestionsLink">Suggestions </a></li> </ul> </div> </td> <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this); document.getElementById('ComDropDown3').style.display = 'inline';" onmouseout="tabOut(this); document.getElementById('ComDropDown3').style.display = 'none';"> <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px; padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/cigars/samplers.asp"> Samplers</a> <div id="ComDropDown3" style="border: 1px solid rgb(71, 42, 24); margin: 28px 0px 0px; display: none; background-color: rgb(235, 230, 208); color: rgb(71, 42, 24); position: absolute; float: left; z-index: 200;" onmouseover="document.getElementById('ComDropDown3').style.display = 'inline';" onmouseout="document.getElementById('ComDropDown3').style.display = 'none';"> <ul style="margin: 0px; padding: 0px; width: 100px;"> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cigars/viewsamplers.asp?subcatid=samp_var'"> <a href="http://www.cigar.com/cigars/viewsamplers.asp?subcatid=samp_var" style="line-height: 25px; color: rgb(71, 42, 24);" id="Variety SamplersLink">Variety Samplers </a> </li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cigars/viewsamplers.asp?subcatid=gift_samp'"> <a href="http://www.cigar.com/cigars/viewsamplers.asp?subcatid=gift_samp" style="line-height: 25px; color: rgb(71, 42, 24);" id="Gift SamplersLink">Gift Samplers </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cigars/createSampler.asp'"><a href="http://www.cigar.com/cigars/createSampler.asp" style="line-height: 25px; color: rgb(71, 42, 24);" id="Custom SamplerLink">Custom Sampler </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cigars/viewsamplers.asp?subcatid=Feat%20Samp'"> <a href="http://www.cigar.com/cigars/viewsamplers.asp?subcatid=Feat%20Samp" style="line-height: 25px; color: rgb(71, 42, 24);" id="Featured SamplersLink">Featured Samplers </a> </li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cigars/YouPickOffer.asp'"><a href="http://www.cigar.com/cigars/YouPickOffer.asp" style="line-height: 25px; color: rgb(71, 42, 24);" id="Brand SamplersLink">U Pick 2 Offer </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cigars/exclusiveCustomSampler.asp'"> <a href="http://www.cigar.com/cigars/exclusiveCustomSampler.asp" style="line-height: 25px; color: rgb(71, 42, 24);" id="Brand SamplersLink">Gurkha Sampler </a></li> </ul> </div> </td> <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this); document.getElementById('ComDropDown4').style.display = 'inline';" onmouseout="tabOut(this); document.getElementById('ComDropDown4').style.display = 'none';"> <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px; padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/gifts/index.asp"> Gifts</a> <div id="ComDropDown4" style="border: 1px solid rgb(71, 42, 24); margin: 28px 0px 0px; display: none; background-color: rgb(235, 230, 208); color: rgb(71, 42, 24); position: absolute; float: left; z-index: 200;" onmouseover="document.getElementById('ComDropDown4').style.display = 'inline';" onmouseout="document.getElementById('ComDropDown4').style.display = 'none';"> <ul style="margin: 0px; padding: 0px; width: 100px;"> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/gifts/viewgifts.asp?subcatid=gift_sets'"> <a href="http://www.cigar.com/gifts/viewgifts.asp?subcatid=gift_sets" style="line-height: 25px; color: rgb(71, 42, 24);" id="Gift SetsLink">Best Sellers </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cigars/viewsamplers.asp?subcatid=gift_samp'"> <a href="http://www.cigar.com/cigars/viewsamplers.asp?subcatid=gift_samp" style="line-height: 25px; color: rgb(71, 42, 24);" id="Gift SamplersLink">Gift Samplers </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/accessories/index.asp'"><a href="http://www.cigar.com/accessories/index.asp" style="line-height: 25px; color: rgb(71, 42, 24);" id="AccesoriesLink">Accesories </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/club/index.asp'"><a href="http://www.cigar.com/club/index.asp" style="line-height: 25px; color: rgb(71, 42, 24);" id="Cigar of the MonthLink">Cigar of the Month </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/gifts/certificates.asp'"><a href="http://www.cigar.com/gifts/certificates.asp" style="line-height: 25px; color: rgb(71, 42, 24);" id="Cigar of the MonthLink">Gift Certificates </a></li> </ul> </div> </td> <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this); document.getElementById('ComDropDown5').style.display = 'inline';" onmouseout="tabOut(this); document.getElementById('ComDropDown5').style.display = 'none';"> <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px; padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/accessories/index.asp"> Accessories</a> <div id="ComDropDown5" style="border: 1px solid rgb(71, 42, 24); margin: 28px 0px 0px; display: none; background-color: rgb(235, 230, 208); color: rgb(71, 42, 24); position: absolute; float: left; z-index: 200;" onmouseover="document.getElementById('ComDropDown5').style.display = 'inline';" onmouseout="document.getElementById('ComDropDown5').style.display = 'none';"> <ul style="margin: 0px; padding: 0px; width: 100px;"> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_hum'"> <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_hum" style="line-height: 25px; color: rgb(71, 42, 24);" id="HumidorsLink">Humidors </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_cutt'"> <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_cutt" style="line-height: 25px; color: rgb(71, 42, 24);" id="CuttersLink">Cutters </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_lite'"> <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_lite" style="line-height: 25px; color: rgb(71, 42, 24);" id="LightersLink">Lighters </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_case'"> <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_case" style="line-height: 25px; color: rgb(71, 42, 24);" id="CasesLink">Cases </a> </li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_humf'"> <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_humf" style="line-height: 25px; color: rgb(71, 42, 24);" id="HumidificationLink">Humidification </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_book'"> <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_book" style="line-height: 25px; color: rgb(71, 42, 24);" id="BooksLink">Books </a> </li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_ash'"> <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_ash" style="line-height: 25px; color: rgb(71, 42, 24);" id="AshtraysLink">Ashtrays </a></li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_misc'"> <a href="http://www.cigar.com/accessories/viewaccessories.asp?subcatid=acc_misc" style="line-height: 25px; color: rgb(71, 42, 24);" id="OtherLink">Other </a> </li> </ul> </div> </td> <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this);" onmouseout="tabOut(this);" onclick="window.location = 'http://www.cigar.com/sales/index.asp'"> <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px; padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/sales/index.asp"> Sales</a> </td> <td class="CommonSimpleTabStripTab" onmouseover="tabOver(this); document.getElementById('ComDropDown8').style.display = 'inline';" onmouseout="tabOut(this); document.getElementById('ComDropDown8').style.display = 'none';"> <a style="float: right; display: block; height: 30px; line-height: 30px; padding-left: 12px; padding-right: 12px; vertical-align: middle;" href="http://www.cigar.com/cs/">Community</a> <div id="ComDropDown8" style="border: 1px solid rgb(71, 42, 24); margin: 28px 0px 0px; display: none; background-color: rgb(235, 230, 208); color: rgb(71, 42, 24); position: absolute; float: left; z-index: 200;" onmouseover="document.getElementById('ComDropDown8').style.display = 'inline';" onmouseout="document.getElementById('ComDropDown8').style.display = 'none';"> <ul style="margin: 0px; padding: 0px; width: 100px;"> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cs/forums/'"><a href="http://www.cigar.com/cs/forums/" style="line-height: 25px; color: rgb(71, 42, 24);" id="ForumsLink">Forums </a> </li> <li class="CommonSimpleTabStripTabSub" style="margin: 0px; padding: 3px; text-align: left; list-style: none outside none;" onmouseover="tabOverSub(this); " onmouseout="tabOutSub(this); " onclick="window.location = 'http://www.cigar.com/cs/blogs/'"><a href="http://w

    Read the article

  • C# Gui setting control.Enabled to false fires OnClick event???

    - by Daniel
    For some really weird reason when i set the .Enabled property to false on a simple text box on a small GUI, it fires a radio buttons OnClick event and its causing lots of problems. I have breakpointed the txtBox.Enabled = false; and after stepping over OR into it i jump straight to the OnClick event of the radio button control Here is the call stack as that happened: TestGUI.exe!TestGUI.frmMain.radiobuttonClicked(object sender = {Text = "Download Single Episode" Checked = true}, System.EventArgs e = {System.EventArgs}) Line 67 C# System.Windows.Forms.dll!System.Windows.Forms.Control.OnClick(System.EventArgs e) + 0x70 bytes System.Windows.Forms.dll!System.Windows.Forms.RadioButton.OnClick(System.EventArgs e) + 0x27 bytes System.Windows.Forms.dll!System.Windows.Forms.RadioButton.OnEnter(System.EventArgs e = {System.EventArgs}) + 0x3e bytes System.Windows.Forms.dll!System.Windows.Forms.Control.NotifyEnter() + 0x20 bytes System.Windows.Forms.dll!System.Windows.Forms.ContainerControl.UpdateFocusedControl() + 0x195 bytes System.Windows.Forms.dll!System.Windows.Forms.ContainerControl.AssignActiveControlInternal(System.Windows.Forms.Control value = {Text = "Download Single Episode" Checked = true}) + 0x54 bytes System.Windows.Forms.dll!System.Windows.Forms.ContainerControl.ActivateControlInternal(System.Windows.Forms.Control control, bool originator = false) + 0x76 bytes System.Windows.Forms.dll!System.Windows.Forms.ContainerControl.SetActiveControlInternal(System.Windows.Forms.Control value = {Text = "Download Single Episode" Checked = true}) + 0x73 bytes System.Windows.Forms.dll!System.Windows.Forms.ContainerControl.SetActiveControl(System.Windows.Forms.Control ctl) + 0x33 bytes System.Windows.Forms.dll!System.Windows.Forms.ContainerControl.ActiveControl.set(System.Windows.Forms.Control value) + 0x5 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.Select(bool directed, bool forward) + 0x1b bytes System.Windows.Forms.dll!System.Windows.Forms.Control.SelectNextControl(System.Windows.Forms.Control ctl, bool forward, bool tabStopOnly, bool nested, bool wrap) + 0x7b bytes System.Windows.Forms.dll!System.Windows.Forms.Control.SelectNextControlInternal(System.Windows.Forms.Control ctl, bool forward, bool tabStopOnly, bool nested, bool wrap) + 0x4a bytes System.Windows.Forms.dll!System.Windows.Forms.Control.SelectNextIfFocused() + 0x61 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.Enabled.set(bool value) + 0x42 bytes What the hell? It wouldn't have anything to do with the way i subscribe to the events would it? this.radioBtnMultipleDownload.Click += radiobuttonClicked; this.radioBtnSingleDownload.Click += radiobuttonClicked; this.radioCustomUrl.Click += radiobuttonClicked;

    Read the article

  • How to add an onclick event to a joint.js element?

    - by ahalbert
    I have a joint.js element in a DAG, and would like to be able to trigger an event by clicking on it. I could use $(selector).click(...) to do it, but I was wondering if there was a joint.js specific way of handling it, since that would probobly be better. One event I decided was a candidate for onclick was 'batch:stop' My code: var variable = new joint.shapes.basic.Rect({ name : label, id: label, onclick : function () {alert("hello");}, size: { width: width, height: height }, attrs: { text: { text: label, 'font-size': letterSize, 'font-family': 'monospace' }, rect: { fill : fillColor, width: width, height: height, rx: 5, ry: 5, stroke: '#555' } } }); variable.on('batch:stop', function (element) {alert(""); toggleEvidence(element.name);}); return variable; How should I add an onclick event?

    Read the article

  • Adding CKEditor through javascript onclick event adds a CKEditor to the DOM but does not allow me to

    - by Mallika Iyer
    Hi, I'm adding a ckeditor to my form using the onclick functionality - i.e., when the user clicks a button, the ckeditor is added to the form. I'm echoing out the html generated when a ckeditor is added to a page through the javascript function. The ckeditor is added, but the text area cannot be modified. is it because i'm adding the html to generate the ckeditor as : ckeditor.innerHTML = '......'; is there another way to add a ckeditor to my form using the javascript onclick (like: onclick="addCKEditor();") Thanks!

    Read the article

  • Jquery background overlay/alert without .onclick event - php responder?

    - by Philip
    Hi guys, I have no experience with jquery or javascript for that matter. I am trying to implement this technique to respond to users for errors or messages in general. lights-out-dimmingcovering-background-content-with-jquery This method uses the onclick event and that's not what im after, I have tried to replace .onclick with .load but that doesn't seem to work. I'm after a quick fix as I really don't have the time to learn jquery or its event handlers. The goal is to catch any errors or message's and once these are called the alert box is called without any further actions such as .onclick. How my code would look: {PHP} $forms = new forms(); if(count($forms->showErrors) > 0 // or == true) { foreach($forms->showErrors as $error) { print('<p class="alert">'.htmlspecialchars($error, ENT_QUOTES).'</p>'); } }

    Read the article

  • Selenium RC: How to click buttons that use onclick window.location?

    - by Andrew
    I have a button (outside of a form) that redirects to another page using the onclick attribute that calls window.location to redirect the user to another page. This time I can't change the HTML. I am using Safari 4 for testing. How can I click a button that uses the onclick attribute and window.location to redirect using Safari 4 and Selenium RC PHPUnit Extension? Here's my HTML: <input type="button" onclick="window.location='/registrations/new'" value="Start a new registration" id="create"> Update: Alternatively, I'm thinking about doing something where I assert that a location is specified in the window.location='', store that location, and call the open() command using that location. Not sure if this is an acceptable approach to testing this.

    Read the article

  • How do you assign a JavaScript 'onclick' attribute dynamically?

    - by Jack Roscoe
    Hi, I'm creating a button dynamically using JavaScript and at the same time assigning attributes such as 'ID', 'type' etc and also 'onclick' in order to trigger a function. All works fine apart from the assignment of the 'onclick'. When clicked, the button is not triggering the function as it is supposed to. the function I'm trying to run is 'navigate(-1)' as seen below. Where am I going wrong? Here's my code: function loadNavigation() { var backButton; backButton = document.createElement('input'); backButton.ID = 'backButton'; backButton.type = 'button'; backButton.value='Back'; backButton.onclick = 'navigate(-1)'; document.body.appendChild(backButton); }

    Read the article

  • Jquery Tools Tabs: How to capture onClick event when selection is on current tab?

    - by littlenewton
    Hi All, I tried to ask this question on the jquery tools forum, but didn't get a response, hopefully someone here can help. Question: It seems the onClick event does not get fired when user is already on current tab, I think that make sense for most cases. However, in my case, I do want to capture the onClick event even when the curent tab is already the selection. Is there a way to do this? Thanks!

    Read the article

  • How can I use $(this) in a function called by the onClick event?

    - by tepkenvannkorn
    I want to set the current state to selected when clicking on each link. I can do this by: <ul class="places"> <li class="selected"> <a href="javascript:void(0)" onclick="myClick(0);"> <span class="date">Saturday November 2, 2013</span> <span class="time">10am – 12pm</span> <span class="location">Western Sydney Parklands</span> </a> </li> <li> <a href="javascript:void(0)" onclick="myClick(1);"> <span class="date">Saturday November 9, 2013</span> <span class="time">10am – 12pm</span> <span class="location">Bankstown High School</span> </a> </li> <li> <a href="javascript:void(0)" onclick="myClick(2);"> <span class="date">Tuesday November 12, 2013</span> <span class="time">9am – 11am</span> <span class="location">Greystanes Park</span> </a> </li> </ul> $(document).ready( function() { $('.places li a').click( function() { $('.places li').removeClass('selected'); $(this).parent().addClass('selected'); }); }); But this will double triggering onclick event an each link because the calling function myClick() is called to push data to map. Then I decided to implement these in the myClick() function: function myClick( id ) { google.maps.event.trigger(markers[id], 'click'); $('.places li').removeClass('selected'); $(this).parent().addClass('selected'); } The problem is that I cannot use $(this) to add class to its parent li. See what I have tried here. Any help would be very much appreciated. Thanks!

    Read the article

  • HTML + javascript mouse over, mouseout, onclick not working in firefox.

    - by help_inmssql
    Hello Everyone, My question is to get onMouseover,onMouseout,onMousedown,onClick on a table row. For which i am calling javascript userdefined functions. onMouseover --- Background color should change. onMouseout --- Reset to original color onClick --- First column checkbox/radio button should be set and background color should change onMousedown --- background color should change. My code in html is:- <tr onMouseOver="hover(this)" onMouseOut="hover_out(this)" onMouseDown="get_first_state(this)" onClick="checkit(this)" > and the methods in javascripts are:- var first_state = false; var oldcol = '#ffffff'; var oldcol_cellarray = new Array(); function hover(element) { if (! element) element = this; while (element.tagName != 'TR') { element = element.parentNode; } if (element.style.fontWeight != 'bold') { for (var i = 0; i<element.cells.length; i++) { if (element.cells[i].className != "no_hover") { oldcol_cellarray[i] = element.cells[i].style.backgroundColor; element.cells[i].style.backgroundColor='#e6f6f6'; } } } } // ----------------------------------------------------------------------------------------------- function hover_out(element) { if (! element) element = this; while (element.tagName != 'TR') { element = element.parentNode; } if (element.style.fontWeight != 'bold') { for (var i = 0; i<element.cells.length; i++) { if (element.cells[i].className != "no_hover") { if (typeof oldcol_cellarray != undefined) { element.cells[i].style.backgroundColor=oldcol_cellarray[i]; } else { element.cells[i].style.backgroundColor='#ffffff'; } //var oldcol_cellarray = new Array(); } } } } // ----------------------------------------------------------------------------------------------- function get_first_state(element) { while (element.tagName != 'TR') { element = element.parentNode; } first_state = element.cells[0].firstChild.checked; } // ----------------------------------------------------------------------------------------------- function checkit (element) { while (element.tagName != 'TR') { element = element.parentNode; } if (element.cells[0].firstChild.type == 'radio') { var typ = 0; } else if (element.cells[0].firstChild.type == 'checkbox') { typ = 1; } if (element.cells[0].firstChild.checked == true && typ == 1) { if (element.cells[0].firstChild.checked == first_state) { element.cells[0].firstChild.checked = false; } set_rowstyle(element, element.cells[0].firstChild.checked); } else { if (typ == 0 || element.cells[0].firstChild.checked == first_state) { element.cells[0].firstChild.checked = true; } set_rowstyle(element, element.cells[0].firstChild.checked); } if (typ == 0) { var table = element.parentNode; if (table.tagName != "TABLE") { table = table.parentNode; } if (table.tagName == "TABLE") { table=table.tBodies[0].rows; //var table = document.getElementById("js_tb").tBodies[0].rows; for (var i = 1; i< table.length; i++) { if (table[i].cells[0].firstChild.checked == true && table[i] != element) { table[i].cells[0].firstChild.checked = false; } if (table[i].cells[0].firstChild.checked == false) { set_rowstyle(table[i], false); } } } } } function set_rowstyle(r, on) { if (on == true) { for (var i =0; i < r.cells.length; i++) { r.style.fontWeight = 'bold'; r.cells[i].style.backgroundColor = '#f2f2c2'; } } else { for ( i =0; i < r.cells.length; i++) { r.style.fontWeight = 'normal'; r.cells[i].style.backgroundColor = '#ffffff'; } } } It is working as expected in IE. But coming to firefox i am surprised on seeing the output after so much of coding. In Firefox:-- onMouseOver is working as expected. color change of that particular row. onClick -- Setting the background color permenantly..eventhough i do onmouseover on different rows. the clicked row color is not reset to white. -- not as expected onclick on 2 rows..the background of both the rows is set...not as expected i.e if i click on all the rows..background color of everything is changed... Eventhough i click on the row. First column i.e radio button or checkbox is not set.. Please help me to solve this issue in firefox. Do let me know where my code needs to be changed... Thanks in advance!!

    Read the article

  • HTML + javascript mouse over, mouseout, onclick not working in firefox.

    - by lucky
    Hello Everyone, My question is to get onMouseover,onMouseout,onMousedown,onClick on a table row. For which i am calling javascript userdefined functions. onMouseover --- Background color should change. onMouseout --- Reset to original color onClick --- First column checkbox/radio button should be set and background color should change onMousedown --- background color should change. My code in html is:- <tr onMouseOver="hover(this)" onMouseOut="hover_out(this)" onMouseDown="get_first_state(this)" onClick="checkit(this)" > and the methods in javascripts are:- var first_state = false; var oldcol = '#ffffff'; var oldcol_cellarray = new Array(); function hover(element) { if (! element) element = this; while (element.tagName != 'TR') { element = element.parentNode; } if (element.style.fontWeight != 'bold') { for (var i = 0; i<element.cells.length; i++) { if (element.cells[i].className != "no_hover") { oldcol_cellarray[i] = element.cells[i].style.backgroundColor; element.cells[i].style.backgroundColor='#e6f6f6'; } } } } // ----------------------------------------------------------------------------------------------- function hover_out(element) { if (! element) element = this; while (element.tagName != 'TR') { element = element.parentNode; } if (element.style.fontWeight != 'bold') { for (var i = 0; i<element.cells.length; i++) { if (element.cells[i].className != "no_hover") { if (typeof oldcol_cellarray != undefined) { element.cells[i].style.backgroundColor=oldcol_cellarray[i]; } else { element.cells[i].style.backgroundColor='#ffffff'; } //var oldcol_cellarray = new Array(); } } } } // ----------------------------------------------------------------------------------------------- function get_first_state(element) { while (element.tagName != 'TR') { element = element.parentNode; } first_state = element.cells[0].firstChild.checked; } // ----------------------------------------------------------------------------------------------- function checkit (element) { while (element.tagName != 'TR') { element = element.parentNode; } if (element.cells[0].firstChild.type == 'radio') { var typ = 0; } else if (element.cells[0].firstChild.type == 'checkbox') { typ = 1; } if (element.cells[0].firstChild.checked == true && typ == 1) { if (element.cells[0].firstChild.checked == first_state) { element.cells[0].firstChild.checked = false; } set_rowstyle(element, element.cells[0].firstChild.checked); } else { if (typ == 0 || element.cells[0].firstChild.checked == first_state) { element.cells[0].firstChild.checked = true; } set_rowstyle(element, element.cells[0].firstChild.checked); } if (typ == 0) { var table = element.parentNode; if (table.tagName != "TABLE") { table = table.parentNode; } if (table.tagName == "TABLE") { table=table.tBodies[0].rows; //var table = document.getElementById("js_tb").tBodies[0].rows; for (var i = 1; i< table.length; i++) { if (table[i].cells[0].firstChild.checked == true && table[i] != element) { table[i].cells[0].firstChild.checked = false; } if (table[i].cells[0].firstChild.checked == false) { set_rowstyle(table[i], false); } } } } } function set_rowstyle(r, on) { if (on == true) { for (var i =0; i < r.cells.length; i++) { r.style.fontWeight = 'bold'; r.cells[i].style.backgroundColor = '#f2f2c2'; } } else { for ( i =0; i < r.cells.length; i++) { r.style.fontWeight = 'normal'; r.cells[i].style.backgroundColor = '#ffffff'; } } } It is working as expected in IE. But coming to firefox i am surprised on seeing the output after so much of coding. In Firefox:-- onMouseOver is working as expected. color change of that particular row. onClick -- Setting the background color permenantly..eventhough i do onmouseover on different rows. the clicked previous row color is not reset to white. -- not as expected onclick on 2 rows..the background of both the rows is set..Only the latest row color should be set. other rows that are selected before should be set back..not as expected i.e if i click on all the rows..background color of everything is changed... Eventhough i click on the row. First column i.e radio button or checkbox is not set.. Please help me to solve this issue in firefox. Do let me know where my code needs to be changed... Thanks in advance!!

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >