Search Results

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

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

  • Calling jQuery method from onClick attribute in HTML

    - by Russell
    I am relatively new to implementing JQuery throughout an entire system, and I am enjoying the opportunity. I have come across one issue I would love to find the correct resolve for. Here is a simple case example of what I want to do: I have a button on a page, and on the click event I want to call a jquery function I have defined. Here is the code I have used to define my method (Page.js): (function($) { $.fn.MessageBox = function(msg) { alert(msg); }; }); And here is my HTML page: <HTML> <head> <script type="text/javascript" src="C:\Sandpit\jQueryTest\jquery-1.3.2.js"></script> <script language="javascript" src="Page.js"></script> </head> <body> <div class="Title">Welcome!</div> <input type="button" value="ahaha" onclick="$().MessageBox('msg');" /> </body> </HTML> (The above code displays the button, but clicking does nothing.) I am aware I could add the click event in the document ready event, however it seems more maintainable to put events in the HTML element instead. However I have not found a way to do this. Is there a way to call a jquery function on a button element (or any input element)? Or is there a better way to do this? Thanks

    Read the article

  • Trouble determining onclick's target

    - by pwseo
    I've tried and tried... and I can't seem to make this work in IE (tested version 6) Can anybody help me? IE complains about an error but refuses to tell which error it is... var a = document.getElementsByTagName("a"); for (i = 0; i < a.length; i++) { if (a[i].getAttribute("class") == "info-link") { a[i].onclick = function(e) { e = e || window.event; var target = e.srcElement || e.target; var info = target.parentNode.getElementsByTagName("div")[0]; if (info.style.display == "none" || info.style.display == "") { info.style.display = "block"; } else { info.style.display = "none"; } return false; } } } <div class="auxdata"> <a href="#" class="info-link">Esta questão possuí dados anexos. Clique para ver.</a> <div style="display: none;" class="info-inner"> <!-- variable stuff here --> </div> </div>

    Read the article

  • dynamic LinkButton OnClick event not working on ASP.Net

    - by user1004472
    I want to create dynamic LinkButton for image, <img> tag is not working dynamically so I am using LinkButton with image. I don't want to provide ID to LinkButton because I want to generate more LinkButton dynamically. I am using following code in Default.aspx <%@ Page Language="C#"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { Response.Write(@"<asp:LinkButton runat=""server"" OnClick=""btn_click""><img src=""close-icon (1).png"" /></asp:LinkButton>"); } public void btn_click(object sender, EventArgs e) { Response.Write("HELLO"); } </script> </head> <body> <form id="form1" runat="server"> <div> </div> </form> </body> </html> I also tried to write tag code in Default.aspx.cs file but not work. It's showing me following error. Error 1 'ASP.default_aspx' does not contain a definition for 'img_Click' and no extension method 'img_Click' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?) Please help me to solve this problem.

    Read the article

  • Werid onclick behavior of images on home screen widget

    - by kknight
    I wrote a home screen widget with one image on it. When the image is clicked, browser will be opened for a url link. Generally, it is working. But a weird thing is that, when I click background, then click the picture, the browser will not be open. Until I click the second time on the picture, the browser opens. The steps to reproduce is below: Click on the home screen widget background. Click on the image on the home screen. The browser is not opened. Click on the image again. The browser is opened. If I didn't click on the background, the image will react to click very well, i.e. browser will be open when the image is clicked the first time. The widget XML file is as below: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget" android:layout_width="320dip" android:layout_height="200dip" android:background="@drawable/prt_base" > <ImageView android:id="@+id/picture1" android:layout_width="134dip" android:layout_height="102dip" android:layout_marginLeft="62dip" android:layout_marginTop="6dip" android:scaleType="center" android:src="@drawable/picture1" /> </RelativeLayout> The code to set OnClick on the picture1 ImageView is as below: defineIntent = new Intent(Intent.ACTION_VIEW, Uri .parse("http://www.google.com")); pendingIntent = PendingIntent .getActivity(context, 0 /* no requestCode */, defineIntent, 0 /* no flags */); updateViews.setOnClickPendingIntent( picId, pendingIntent); Anyone knows what's wrong? Thanks.

    Read the article

  • HTML5 Video Element on iPad doesn't fire onclick?

    - by bhups
    I am using the video element in my HTML as following:<div id="container" style="background:black; overflow:hidden;width:320px;height:240px" <video style="background:black;display:block" id="vdo" height="240px" width="320px" src="http://mydomain/vid.mp4"</video</div And in javascript I am doing this:var video=document.getElementById('vdo'); var container=document.getElementById('container'); video.addEventListener('click', function(e) { e.preventDefault(); console.log("clicked"); }, false); container.addEventListener('click', function(e) { e.preventDefault(); console.log("clicked"); }, false); On desktop safari/chrome everything is working fine. I can see two "clicked" in the console. But on ipad there is nothing. First I tried with iOS versin 3.2, then I updated it to the latest one 4.2.1 without any success.I found a similar question HTML5 Video Element on iPad doesn't fire onclick or touchstart events? where it suggests not to use controls in video tag and I am not using it.

    Read the article

  • Load on page inside another onClick

    - by Robin I Knight
    Hello, I need to include the content, scripts, forms and dynamic abilities of one page in another onClick. Take a look at http://www.divethegap.com/scuba-diving-programmes-dive-the-gap/dahab-master-scuba-diver.html Then follow one of the links that says 'Beginner' 'Open Water Diver' etc.... You will find a PHP page with a series of options. It is an adaption of the wordpress blog system to produce only specific options for specific programmes by considering each type of each diving programme a category and then displaying only results from that category. You will see that each option is also a collapsible panel and there are also several javascripts that calculate durations, quantities and prices. There is also a validating webform at the end. Now go back to the first page. What I would like to do is include all the content from the second page after the main header inside tabbed panels on the first page so that the customers can immidietly see everything that is included. Essentially the options on the first page would become a series of tabs. The only way I can see to do this is with an iFrame as each option would need a unique URL ending (that is .php?cat=26 or .php?cat=27). THe problem is that the collapsible panels will not work with an iFrame as the iFrame will not resize when the panels open. There were also some calculation problems, but I think that was more down to me staring at the screen for the last 3 hours not remembering to include everything. I have tried it with resizing iframe SSI scripts and have got nowhere. I tried actually embedding it in the page better with a ajax script, but that left behind all the scripts that make it work. I checked with full URL's on everything and it would not take work with any scripts. I know that you could just make the whole page reload but then the user would be at the top of the page again, and even if another script was applied to slowly bring them down again it would not be anything near as easy to use as if it was like tabbed panels. Any ideas. Kind Regards,

    Read the article

  • Javascript tabs: call event onclick

    - by Joris
    I got some code I need to change. it is build by others, and not very neat... There is a javascript tabcontrol, containing 4 tabs, which contains gridviews. All the 4 gridviews are build during the load of the page, but I want them to load, when you activate the tabs (as it is possible to watch the side, while you don't need the specific gridviews to see) So, my question is: how to call an event (that loads the gridview) from an javascript tab? how the tabs are generated: (generated code, I know, horrible) var obj = 0; var oid = 0; var otb = 0; var myTabs = new Array(); var myTabitems = new Array(); var myTabitem = new Array(); var myTabContent = new Array(); var myLists = new Array(); function showTabContent(tab) { tb = tab.obj; id = tab.nr; if (myTabs[tb].oid != -1) { myTabs[tb].myTabContent[myTabs[tb].oid].style.display = 'none'; myTabs[tb].myTabitem[myTabs[tb].oid].className -= " active"; } myTabs[tb].myTabContent[id].style.display = 'block'; myTabs[tb].myTabitem[id].className += " active"; myTabs[tb].oid = id; } function boTabs() { var myBlocks = new Array(); myBlocks = document.getElementsByTagName("div"); var stopit = myBlocks.length; for (var g = 0; g < stopit; g++) { if (myBlocks[g].className == "tabs") { myTabs.push(myBlocks[g]); } } var stopit2 = myTabs.length; for (var i = 0; i < stopit2; i++) { myTabs[i].myLists = myTabs[i].getElementsByTagName("ul"); if (myTabs[i].myLists[0].className == "tabs") { myTabs[i].myTabitems = myTabs[i].myLists[0].getElementsByTagName("li"); } var stopit3 = myTabs[i].myTabitems.length; myTabs[i].obj = i; myTabs[i].myTabitem = new Array(); myTabs[i].myTabContent = new Array(); for (var j = 0; j < stopit3; j++) { myTabs[i].myTabitem.push(myTabs[i].myTabitems[j]); myTabs[i].myTabitem[j].nr = j; myTabs[i].myTabitem[j].obj = i; myTabs[i].myTabitem[j].onclick = function() { showTabContent(this); }; } var myTabDivs = myTabs[i].getElementsByTagName("div"); for (var j = 0; j < myTabDivs.length; j++) { if (myTabDivs[j].className == "tabcontent") { myTabs[i].myTabContent.push(myTabDivs[j]); } } myTabs[i].myTabitem[0].className += " active"; myTabs[i].myTabContent[0].style.display = 'block'; myTabs[i].oid = 0; myTabDivs = null; } myBlocks = null; } onload = boTabs;

    Read the article

  • Microsoft JScript runtime error: Object expected for onclick="__doPostBack('ctl01$ContentArea1$ctl0

    - by xrx215
    in ascx page i have added a cutom button as follows xrx:CustomButton id="CustomButton4" runat="server" OnClientClick="Login" Text="Login" / in ascx.cs i have protected void Page_Load(object sender, EventArgs e) { CustomButton4.OnClientClick = Page.ClientScript.GetPostBackEventReference(this.CustomButton4, string.Empty); this.lblAppName.Text = this.AppName; lblsession.Text = this.GetString("SDE_SESSION_EXPIRED_PLEASE1"); } protected void Login(object sender, EventArgs e) { Xerox.FMP.Providers.FormsAuthentication formsAuthHelper = new Xerox.FMP.Providers.FormsAuthentication(); formsAuthHelper.SignOut(); Response.Redirect("~/LoginPage.aspx", true); } when i click on login button the page is not redirecting to loginpage.aspx instead it is throwing an error object expected. Can you please help me with this issue.

    Read the article

  • How to programmatically disable onClick handler on Android AppWidget Button

    - by Gaks
    I have a Button on appwidget, that I need to 'enable'/'disable' programmatically from a Service. First idea was to call setBoolean(R.id.buttonid, "setClickable", false) to disable it, but apparently you can't call setClickable remotely. Another idea was was remove the text label from it with rv.setTextViewText(R.id.buttonid, "") and then remove the click handler by rv.setOnClickPendingIntent(R.id.buttonid, null). Unfortunately passing null to it causes NullPointerException in in android.app.ActivityThread.handleServiceArgs Is there some other way to programmatically disable/enable appwidget Button? I could just call rv.setViewVisibility(R.id.buttonid, View.GONE) to hide the button completely instead of disabling it. This would however completely break whole widget layout and I would like to avoid it. The solution I'm using now is hiding the button with setViewVisibility and showing other blank button instead to the keep appwidget layout as it was before.

    Read the article

  • ASP.Net: Adding client side onClick to a HyperlinkField in GridView

    - by Nir
    I have an existing GridView which contains the field "partner name". It is sortable by partner name. Now I need to change the Partner Name field and in some condition make it clickable and alert() something. The existing code is: <asp:GridView ID="gridViewAdjustments" runat="server" AutoGenerateColumns="false" AllowSorting="True" OnSorting="gridView_Sorting" OnRowDataBound="OnRowDataBoundAdjustments" EnableViewState="true"> <asp:BoundField DataField="PartnerName" HeaderText="Name" SortExpression="PartnerName"/> I've added the column: <asp:hyperlinkfield datatextfield="PartnerName" SortExpression="PartnerName" headertext="Name" ItemStyle-CssClass="text2"/> which enables me to control the CSS and sort. However, I can't find how to add a client side javascript function to it. I found that adding : <asp:TemplateField HeaderText="Edit"> <ItemTemplate> <a id="lnk" runat="server">Edit</a> enable me to access "lnk" by id and add to its attributes. However, I lose the Sort ability. What's the correct solution in this case? Thanks.

    Read the article

  • uibutton onclick does not call/open web page

    - by raqz
    i have two buttons defined. one of them when clicked must open a compose mail screen and the other when clicked must call. i have this defined as below. but when the button is pressed, it does not open either -(IBAction) phoneButtonPressed:(id) sender{ NSString *phoneNumber = [[NSString alloc] initWithString:@"4216483330"]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]]; } -(IBAction) mailButtonPressed:(id) sender{ [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto:[email protected]?subject=ULS Library"]]; }

    Read the article

  • Jquery onclick change value

    - by user342391
    I have some jquery tabs on my page the code for them is: //tabs options $("#tabs").tabs({ collapsible: true, selected: -1 }); I want to create a button that will toggle the above option 'selected: -1' I need it to change the value of 'selected' to '0' then back to '-1' How would I do this? <a href="#">Toggle View</a>

    Read the article

  • Convert flyout menu to respond onclick vs mouseover

    - by Scott B
    The code below creates a nifty flyout menu action on a nested list item sequence. The client has called and wants the change the default behavior in which the flyouts are triggered by mouseover, so that you have to click to trigger a flyout. Ideally, I would just like to modify this code so that you click on a small icon (plus/minus) that sits to the right of the menu item if it has child menus. Can someone give me a bit of guidance on what bits I'd need to change to accomplish this? /* a few sniffs to circumvent known browser bugs */ var sUserAgent = navigator.userAgent.toLowerCase(); var isIE=document.all?true:false; var isNS4=document.layers?true:false; var isOp=(sUserAgent.indexOf('opera')!=-1)?true:false; var isMac=(sUserAgent.indexOf('mac')!=-1)?true:false; var isMoz=(sUserAgent.indexOf('mozilla/5')!=-1&&sUserAgent.indexOf('opera')==-1&&sUserAgent.indexOf('msie')==-1)?true:false; var isNS6=(sUserAgent.indexOf('netscape6')!=-1&&sUserAgent.indexOf('opera')==-1&&sUserAgent.indexOf('msie')==-1)?true:false; var dom=document.getElementById?true:false; /* sets time until menus disappear in milliseconds */ var iMenuTimeout=1500; var aMenus=new Array; var oMenuTimeout; var iMainMenusLength=0; /* the following boolean controls the z-index property if needed */ /* if is only necessary if you have multiple mainMenus in one file that are overlapping */ /* set bSetZIndeces to true (either here or in the HTML) and the main menus will have a z-index set in descending order so that preceding ones can overlap */ /* the integer iStartZIndexAt controls z-index of the first main menu */ var bSetZIndeces=true; var iStartZIndexAt=1000; var aMainMenus=new Array; /* load up the submenus */ function loadMenus(){ if(!dom)return; var aLists=document.getElementsByTagName('ul'); for(var i=0;i<aLists.length;i++){ if(aLists[i].className=='navMenu')aMenus[aMenus.length]=aLists[i]; } var aAnchors=document.getElementsByTagName('a'); var aItems = new Array; for(var i=0;i<aAnchors.length;i++){ // if(aAnchors[i].className=='navItem')aItems[aItems.length] = aAnchors[i]; aItems[aItems.length] = aAnchors[i]; } var sMenuId=null; var oParentMenu=null; var aAllElements=document.body.getElementsByTagName("*"); if(isIE)aAllElements=document.body.all; /* loop through navItem and navMenus and dynamically assign their IDs */ /* each relies on it's parent's ID being set before it */ for(var i=0;i<aAllElements.length;i++){ if(aAllElements[i].className.indexOf('x8menus')!=-1){ /* load up main menus collection */ if(bSetZIndeces)aMainMenus[aMainMenus.length]=aAllElements[i]; } // if(aAllElements[i].className=='navItem'){ if(aAllElements[i].tagName=='A'){ oParentMenu = aAllElements[i].parentNode.parentNode; if(!oParentMenu.childMenus) oParentMenu.childMenus = new Array; oParentMenu.childMenus[oParentMenu.childMenus.length]=aAllElements[i]; if(aAllElements[i].id==''){ if(oParentMenu.className=='x8menus'){ aAllElements[i].id='navItem_'+iMainMenusLength; //alert(aAllElements[i].id); iMainMenusLength++; }else{ aAllElements[i].id=oParentMenu.id.replace('Menu','Item')+'.'+oParentMenu.childMenus.length; } } } else if(aAllElements[i].className=='navMenu'){ oParentItem = aAllElements[i].parentNode.firstChild; aAllElements[i].id = oParentItem.id.replace('Item','Menu'); } } /* dynamically set z-indeces of main menus so they won't underlap */ for(var i=aMainMenus.length-1;i>=0;i--){ aMainMenus[i].style.zIndex=iStartZIndexAt-i; } /* set menu item properties */ for(var i=0;i<aItems.length;i++){ sMenuId=aItems[i].id; sMenuId='navMenu_'+sMenuId.substring(8,sMenuId.lastIndexOf('.')); /* assign event handlers */ /* eval() used here to avoid syntax errors for function literals in Netscape 3 */ eval('aItems[i].onmouseover=function(){modClass(true,this,"activeItem");window.clearTimeout(oMenuTimeout);showMenu("'+sMenuId+'");};'); eval('aItems[i].onmouseout=function(){modClass(false,this,"activeItem");window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout("hideMenu(\'all\')",iMenuTimeout);}'); eval('aItems[i].onfocus=function(){this.onmouseover();}'); eval('aItems[i].onblur=function(){this.onmouseout();}'); //aItems[i].addEventListener("keydown",function(){keyNav(this,event);},false); } var sCatId=0; var oItem; for(var i=0;i<aMenus.length;i++){ /* assign event handlers */ /* eval() used here to avoid syntax errors for function literals in Netscape 3 */ eval('aMenus[i].onmouseover=function(){window.clearTimeout(oMenuTimeout);}'); eval('aMenus[i].onmouseout=function(){window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout("hideMenu(\'all\')",iMenuTimeout);}'); sCatId=aMenus[i].id; sCatId=sCatId.substring(8,sCatId.length); oItem=document.getElementById('navItem_'+sCatId); if(oItem){ if(!isOp && !(isMac && isIE) && oItem.parentNode)modClass(true,oItem.parentNode,"hasSubMenu"); else modClass(true,oItem,"hasSubMenu"); /* assign event handlers */ eval('oItem.onmouseover=function(){window.clearTimeout(oMenuTimeout);showMenu("navMenu_'+sCatId+'");}'); eval('oItem.onmouseout=function(){window.clearTimeout(oMenuTimeout);oMenuTimeout=window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout(\'hideMenu("navMenu_'+sCatId+'")\',iMenuTimeout);}'); eval('oItem.onfocus=function(){window.clearTimeout(oMenuTimeout);showMenu("navMenu_'+sCatId+'");}'); eval('oItem.onblur=function(){window.clearTimeout(oMenuTimeout);oMenuTimeout=window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout(\'hideMenu("navMenu_'+sCatId+'")\',iMenuTimeout);}'); //oItem.addEventListener("keydown",function(){keyNav(this,event);},false); } } } /* this will append the loadMenus function to any previously assigned window.onload event */ /* if you reassign this onload event, you'll need to include this or execute it after all the menus are loaded */ function newOnload(){ if(typeof previousOnload=='function')previousOnload(); loadMenus(); } var previousOnload; if(window.onload!=null)previousOnload=window.onload; window.onload=newOnload; /* show menu and hide all others except ancestors of the current menu */ function showMenu(sWhich){ var oWhich=document.getElementById(sWhich); if(!oWhich){ hideMenu('all'); return; } var aRootMenus=new Array; aRootMenus[0]=sWhich var sCurrentRoot=sWhich; var bHasParentMenu=false; if(sCurrentRoot.indexOf('.')!=-1){ bHasParentMenu=true; } /* make array of this menu and ancestors so we know which to leave exposed */ /* ex. from ID string "navMenu_12.3.7.4", extracts menu levels ["12.3.7.4", "12.3.7", "12.3", "12"] */ while(bHasParentMenu){ if(sCurrentRoot.indexOf('.')==-1)bHasParentMenu=false; aRootMenus[aRootMenus.length]=sCurrentRoot; sCurrentRoot=sCurrentRoot.substring(0,sCurrentRoot.lastIndexOf('.')); } for(var i=0;i<aMenus.length;i++){ var bIsRoot=false; for(var j=0;j<aRootMenus.length;j++){ var oThisItem=document.getElementById(aMenus[i].id.replace('navMenu_','navItem_')); if(aMenus[i].id==aRootMenus[j])bIsRoot=true; } if(bIsRoot && oThisItem)modClass(true,oThisItem,'hasSubMenuActive'); else modClass(false,oThisItem,'hasSubMenuActive'); if(!bIsRoot && aMenus[i].id!=sWhich)modClass(false,aMenus[i],'showMenu'); } modClass(true,oWhich,'showMenu'); var oItem=document.getElementById(sWhich.replace('navMenu_','navItem_')); if(oItem)modClass(true,oItem,'hasSubMenuActive'); } function hideMenu(sWhich){ if(sWhich=='all'){ /* loop backwards b/c WinIE6 has a bug with hiding display of an element when it's parent is already hidden */ for(var i=aMenus.length-1;i>=0;i--){ var oThisItem=document.getElementById(aMenus[i].id.replace('navMenu_','navItem_')); if(oThisItem)modClass(false,oThisItem,'hasSubMenuActive'); modClass(false,aMenus[i],'showMenu'); } }else{ var oWhich=document.getElementById(sWhich); if(oWhich)modClass(false,oWhich,'showMenu'); var oThisItem=document.getElementById(sWhich.replace('navMenu_','navItem_')); if(oThisItem)modClass(false,oThisItem,'hasSubMenuActive'); } } /* add or remove element className */ function modClass(bAdd,oElement,sClassName){ if(bAdd){/* add class */ if(oElement.className.indexOf(sClassName)==-1)oElement.className+=' '+sClassName; }else{/* remove class */ if(oElement.className.indexOf(sClassName)!=-1){ if(oElement.className.indexOf(' '+sClassName)!=-1)oElement.className=oElement.className.replace(' '+sClassName,''); else oElement.className=oElement.className.replace(sClassName,''); } } return oElement.className; /* return new className */ } //document.body.addEventListener("keydown",function(){keyNav(event);},true); function setBubble(oEvent){ oEvent.bubbles = true; } function keyNav(oElement,oEvent){ alert(oEvent.keyCode); window.status=oEvent.keyCode; return false; }

    Read the article

  • Get text from listview onclick (Android)

    - by dweebsonduty
    I am creating lists in my android app and would like to capture the text of the list item that is clicked but I want to do it in a seperate function so I only have to write the code once. And I want to be able to compare the string to another sting. What is the best way to do this?

    Read the article

  • onclick form submit, open jQuery loading image until form submit complete

    - by Jackson
    Hi Team, Can you offer a bit of advice. I am using a hosted SAAS CMS solution that enables you to create basing apps with a web apps system. I have created a form for members to submit a bunch of images and content to their own area. Everything is working great except if the images being submitted via the form are large, it takes ages for the form to submit and go to the thank you page. I am already using jQuery UI to split the form in to 5 steps and using the jQuery facebox plugin for instructional popups. My question is, what would be the best way to display a loading gif (in facebox or in another suggested overlay) while the form is being submitted? Thanks for your help! Jack

    Read the article

  • Populating form fields with comma seperated strings in unordered list onclick with jQuery/Javascript

    - by RyanP13
    Hi, I have an address lookup system which returns addresses in an unordered list like so: <p>Please select your address from the list below</p> <div id="selectAddress"> <ul> <li>HNO 412,addressLine2,addressLine8</li> <li>HNO 413,addressLine2,addressLine8</li> <li>HNO 414,addressLine2,addressLine8</li> </ul> </div> When someone clicks on an li containing the address i use the folloqing jQuery to split it and populate the following form fields. var $customerAddress = $("form#detailsForm input[name*='customerAddress']"); $("div#selectAddress ul li").click(function(){ $(this).removeClass("addressHover"); $("li.addressClick").removeClass("addressClick"); $(this).addClass("addressClick"); var $splitAddress = $(this).text().split(","); $($customerAddress).closest("tr").removeClass("hide"); $($customerAddress).each(function(){ var $inputCount = $(this).index($customerAddress); $(this).val($splitAddress[$inputCount]); }); $.cookies.set('cpqbAddressInputs', 'visible'); }); Form fields: <tr> <th> <label for="customerAddressLine1">Address&nbsp;*</label> </th> <td colspan="3"> <input type="text" name="customerAddressLine1" maxlength="40" value="" id="customerAddressLine1" class="text" /> </td> However it only seems to populate the first line of the address and not lines two and three. I could easily do this manually but i wanted to abstract it so that it could be expanded to cater for any amounts of address lines.

    Read the article

  • YUI button onclick get value

    - by Simon
    I have a a set of yui buttons generated using the standard yui html. <span class="yui-button yui-checkbox-button" id="analystbutton1"> <span class="first-child"> <button type="button" class="facetbutton" tabindex="0" id="analystbutton1-button"> Joe Bloggs </button> </span> </span> I create the buttons like so, and I then have some javascript to create the button and the listener. var analystCButton1 = new YAHOO.widget.Button("analystbutton1", { type:"checkbox", value:"BLOGGS", checked:false }); analystCButton1.on("click", onFacetClick); Finally I have the onFacetClick function var onFacetClick = function (e) { // e is the event var target = YAHOO.util.Event.getTarget(e); var button = new YAHOO.widget.Button(target); alert(button.get('type')); alert(button.get('id')); alert(button.get('value')); }; When I click on any of my buttons the first two alerts display the type and id (although not what I would expect). I cannot get the value, the alert doesn't fire, but I see no error in FireBug or the error console. alert(button.get('type')); returns push - I would expect checkbox alert(button.get('id')); returns analystbutton1-button

    Read the article

  • Programmatically change the width/height of ColorBox onClick.

    - by Derek Adair
    Hi, I'm using the jquery plugin ColorBox. I have a page with several item listings. Each listing has a ColorBox attached to it. $("a.modalButton").each(function(){ $(this).colorbox({ width:"933px", height:"720px", iframe:true, onComplete:function(){ //remove the text from the close button //wasn't sure how else to do that $('#cboxClose').html(''); } }); }); In each ColorBox window there is an "email me" button. When it is clicked I replace the html content that is in the window with a form to email the listing. I would like the window to resize to fit the form after this button is clicked

    Read the article

  • Fade effect onclick (jQuery)

    - by Nimbuz
    I have this very basic tabbed block: $('.tabbed-section .panel').hide(); $('.tabbed-section .panel:first').show(); $('.tabbed-section .tabs li:first').addClass('active'); $('.tabbed-section .tabs li a').click(function () { $('.tabbed-section .tabs li').removeClass('active'); $(this).parent().addClass('active'); var currentTab = $(this).attr('href'); var tab_id = $(this).attr('href'); $(this).closest('#hero').attr('class', 'clear ' + tab_id.replace('#', '')); $('.tabbed-section .panel').hide(); $(currentTab).show(); return false; }); .. it works great, but can I add fade effect when the active tab changes? I think there's a plugin (innerfade) for it but I want to avoid using another plugin if possible. Also, can the jQuery above be compacted further? Thanks for your help!

    Read the article

  • asp.net-mvc return a couple of partial views onclick

    - by niao
    Greetings, I have an asp.net mvc application. When button is clicked (submit button) i would like to results to be displayed inside some div. I know how to do it. I have some action where I return a partial view. But when button is submitted then I get some multiple objects from db and I would like to display them all in div. How can I achieve it?

    Read the article

  • Can I increase a buttons onclick-area programmatically?

    - by sandis
    Sometimes I have a button in my UI that it is so small that it is difficult to click. My solution so far has been to add a transparent border around the button in photoshop. Just increasing the padding on the button does not work, since this will also stretch the image. Since it is kind of a fuss to open photoshop each time I want to change the clickable surface, is there any way to do this programmatically? I have tried placing a framelayout behind the button and make it clickable, but then the button wont change appearance on touch as it should. Ofcourse I could also add a ontouchlistener on the framelayout which changes the buttons appearance, but then it quite some code if I have several of those buttons. Cheers,

    Read the article

  • how to change onclick event with jquery?

    - by user550758
    I have create a js file in which i am creating the dynamic table and dynamically changing the click event for the calendar but onclicking the calender image for dynamic generated table, calendar popup in the previous calendar image. Please help me code /***------------------------------------------------------------ * *Developer: Vipin Sharma * *Creation Date: 20/12/2010 (dd/mm/yyyy) * *ModifiedDate ModifiedBy Comments (As and when) * *-------------------------------------------------------------*/ var jq = jQuery.noConflict(); var ia = 1; jq(document).ready(function(){ jq("#subtaskid1").click(function() { if(ia<=10){ var create_table = jq("#orgtable").clone(); create_table.find("input").each(function() { jq(this).attr({ 'id': function(_, id) { return ia + id }, 'name': function(_, name) { return ia + name }, 'value': '' }); }).end(); create_table.find("select").each(function(){ jq(this).attr({ 'name': function(_,name){ return ia + name } }); }).end(); create_table.find("textarea").each(function(){ jq(this).attr({ 'name': function(_,name){ return ia + name } }); }).end(); create_table.find("#f_trigger_c").each(function(){ var oclk = " displayCalendar(document.prjectFrm['"+ ia +"dtSubDate'],'yyyy-mm-dd', this)"; //ERROR IS HERE var newclick = new Function(oclk); jq(this).click(newclick); }).end(); create_table.appendTo("#subtbl"); jq('#maxval').val(ia); ia++; }else{ var ai = ia-1; alert('Only ' + ai + ' SubTask can be insert'); } }); });

    Read the article

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