Search Results

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

Page 4/111 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Javascript to change image form submit button src not working.

    - by james
    I'm trying to change the src of an image form submit button using an onclick, but it doesn't seem to be working correctly. Am I missing something? <input class="submit_image" id="my_form_button" onclick="$('my_form_button').src='/images/buttons/submitting.gif'" src="/images/buttons/submit.gif" type="image" /> I've also tried using the same JS on the form tag using onsubmit with no luck.

    Read the article

  • Android accessibility focus - clicking a view changes focus to previous view

    - by benkdev
    I'm using android TalkBack to test my application for accessibility use. When I swipe to select a view and double tap, the focus returns the the view above it. Usually when swiping to a view and double clicking it, onClick is called. What am I doing wrong? <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/all_white" > <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/header" android:scaleType="center" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/green_bar" android:scaleType="center" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/blue_bar" android:scaleType="center" /> <EditText android:id="@+id/username" android:layout_width="325dp" android:layout_height="wrap_content" android:hint="@string/username" android:focusable="true" android:nextFocusDown="@id/password" /> <EditText android:id="@+id/password" android:inputType="textPassword" android:layout_width="325dp" android:layout_height="wrap_content" android:hint="@string/password" android:focusable="true" android:nextFocusUp="@id/username" android:nextFocusDown="@id/login" /> <Button android:id="@+id/login" android:onClick="doLogin" android:focusable="true" android:layout_width="325dp" android:layout_height="wrap_content" android:text="@string/login" android:nextFocusUp="@id/password" android:nextFocusDown="@id/create_trial_account" /> <Button android:id="@+id/create_trial_account" android:layout_width="100dip" android:layout_height="wrap_content" android:text="@string/new_user" android:onClick="createAccount" android:focusable="true" android:nextFocusUp="@id/login" /> <TextView android:id="@+id/copyright" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/copyright" /> <TextView android:id="@+id/buildNumber" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout>

    Read the article

  • Lazarus - why I can't assign event to run-time component?

    - by Garret Raziel
    Hello, I have this Lazarus program: unit Unit2; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls; type { TForm2 } TForm2 = class(TForm) procedure OnTlacitkoClick(Sender: TObject); procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure FormCreate(Sender: TObject); tlac:TButton; private { private declarations } public { public declarations } end; var Form2: TForm2; implementation { TForm2 } procedure TForm2.OnTlacitkoClick(Sender: TObject); begin showmessage('helloworld'); end; procedure TForm2.FormCreate(Sender: TObject); var i,j:integer; begin tlac:=TButton.Create(Form2); tlac.OnClick:=OnTlacitkoClick; tlac.Parent:=Form2; tlac.Left:=100; tlac.Top:=100; end; initialization {$I unit2.lrs} end. but compiler says: unit2.pas(63,32) Error: Wrong number of parameters specified for call to "OnTlacitkoClick" in tlac.OnClick:=OnTlacitkoClick; expression. I have searched and think that this is legal expression in Delphi. I want simply to registrate OnTlacitkoClick as tlac.OnClick event,not to call this procedure. Is there somethink wrong with the code or must I do it different in Lazarus/Freepascal? Thanks.

    Read the article

  • AddEvenLister fires off immediately after being attached

    - by Diego
    I want to know how to correctly add an Event Listener like onClick to a dynamic div. Here’s my snippet: var $menu = new Array(2); createDiv('yes'); function createDiv(title) { var $class = 'menuLink'; var $title = 'title'; for(var i=0; i<$menu.length;i++) { $title = 'title'; var newdiv = document.createElement('div'); newdiv.setAttribute('class', $class); newdiv.setAttribute('id', 'item'+i); newdiv.addEventListener('onclick', clickHandle(newdiv.id),false); if (title) { newdiv.innerHTML = $title; } else { newdiv.innerHTML = "No Title"; } document.getElementById('menu').appendChild(newdiv); showMenu(); } } function clickHandle(e) { if(e == 'item0') { alert('Link is' + ' ' + e); }else{ alert('Another Link'); } } Here's my problem, the snippet works fine, It creates my divs, adds id's values and all, but the event fires off as soon as the event is attached, so while the for loop is creating the divs the alert window says: Link is item0, and immediately after this it says: Another Link. Am I misunderstanding this? (I used this method zillions of times in AS3 with the expected result, just attached a function waiting for a click). What I want is that my Divs wait for the user to click on them, not to fire off immediately after of being attached. Thanks for any hint on this one. Greetings. Ps. IE doesn't support addEventListener, but I want to resolve this before cross to the IE sea of madness, but I will appreciate the IE approach as well. - I tried "onclick" and just 'click' into the addEventListener line, both with the same result described above.

    Read the article

  • HTML form never calls Javascript

    - by user1205577
    I have a set of radio buttons defined in HTML like so: <input type="radio" name="group" id="rad1" value="rad1" onClick="doStuff(this.id)">Option 1<br> <input type="radio" name="group" id="rad2" value="rad2" onClick="doStuff(this.id)">Option 2<br> Just before the </body> tag, I have the following JavaScript behavior defined: <script type="text/javascript"> /*<![CDATA[*/ function doStuff(var id){ alert("Doing stuff!"); } /*]]>*/ </script> When I run the program, the page loads as expected in my browser window and the radio buttons allow me to click them. The doStuff() function, however, is never called (I validated this using breakpoints as well). I also tried the following just to see if inline made the difference, but it seems the JavaScript is never called at all: <script type="text/javascript"> /*<![CDATA[*/ alert("JavaScript called!"); main(); function main(){ var group = document.getElementsByName('group'); for(var i=0; i<group.length; i++){ group[i].onclick = function(){ doStuff(this.id); }; } } /*]]>*/ </script> My question is, is there something special I need to do using HTML and JavaScript in this context? My question is not whether I should be using inline function calls or whether this is your favorite way to write code.

    Read the article

  • Manipulating jQuery to retrieve the onclick function of an item which lies directly below the curren

    - by Stevie Jenowski
    First off, I want to thank you for looking into my question as I really do appreciate your time. I've built a list of items using php by having a foreach loop cycle through an associative array printing the array data as parameters of an onclick function call and gives each item it cycles through an ID of $thecount. All items retrieved have the same parent div and calls the very same onclick function, only with 11 different parameters. My question is how do I go about calling the onClick("function();") of an item directly below the current focus, making it the new focus, only without a physical click? If this is confusing to you whatsoever, I'm essentially building a dynamic playlist, and I've already implemented the listener for when the player's current item has finished playing, Now I'm having trouble grasping how I'd go about having the next item in the list become the new focus while also calling it's specific onClick() function once the player returns that it has finished with the current file. All without any user interaction besides the initial play call. If it helps I'm using the most recent release of Longtails' JW Player and once again thank you very much for your time!

    Read the article

  • Buttons OnClick Event not firing when it causes a textboxes onChange event to fire first

    - by user48408
    I have a few textboxes and button to save their values on a webpage. The onchange event of the textboxes fires some js which adds the changed text to a js array. The ok button when clicked flushes this to the database via a webservice. This works fine except when the onchange event is caused by clicking the ok button. In this scenario the onchange of the textboxes still fires but the onClick event of the button does not. Any ideas? textboxes look something like <input name="ctrlJPView$tbcTabContainer$Details$JP_Details_Address2Text" type="text" value="test" id="ctrlJPView_tbcTabContainer_Details_JP_Details_Address2Text" onchange="addSaveDetails('Jobs###' + document.getElementById('ctrlJPView_tbcTabContainer_Details_JP_Details_Address2Text').value + ');" style="font-size:8pt;Left:110px;Top:29px;Width:420px;Height:13px;Position:absolute;" /> My save button <input type="button" name="ctrlJPView$btnOk" value="OK" onclick="saveAmendments();refreshJobGrids();return false;__doPostBack('ctrlJPView$btnOk','')" id="ctrlJPView_btnOk" class="ControlText" style="width:60px;" /> UPDATE: I guess this comes down to one of two things. 1) Something is happening before the onClick of the button gets called to surpress that call such as an inadvertent return false; or 2) the onClick event isn't firing at all. Now I've rem'd out everything actually inside the functions that are being called beforehand but the problem persists. But if i remove the call altogether it works (???)

    Read the article

  • IE ignores added onclick attribute

    - by user357034
    The Jquery code below works ok with firefox, Safari, Opera but not with IE. I kinda know why this isn't working in IE after reading a lot about it but I do not know how to fix it. My understanding (I think) is that this method will assign a attribute of "onclick" in IE rather than an event method. Therefore it will not fire in IE and the href fires instead which in this case is "#" which is exactly what is happening. What is the correct way of adding the onclick event. <a id="product_photo_zoom_url" href="/PhotoGallery.asp?ProductCode=9857%2D116%2D003" title="9857-116-003 Ignition box"><img id="product_photo" src="/v/vspfiles/photos/9857-116-003-2T.jpg" border="0" alt="9857-116-003 Ignition box" /></a> <br /><a id="product_photo_zoom_url2" href="/PhotoGallery.asp?ProductCode=9857%2D116%2D003" title="9857-116-003 Ignition box"> <img src="/v/vspfiles/templates/100/images/buttons/btn_largerphoto.gif" border="0"></a> var global_URL_Encode_Current_ProductCode; var global_Config_ProductPhotosFolder; var global_Current_ProductCode; var titleattr = $("a#product_photo_zoom_url").attr("title"); var picurl='tb_show(titleattr, \'/PhotoDetails.asp?ShowDESC=N&ProductCode=\' + global_URL_Encode_Current_ProductCode + \'&TB_iframe=true&height=600&width=520\');return false;' $("a#product_photo_zoom_url").attr('onclick', picurl); $("a#product_photo_zoom_url").attr('href', '#'); $("a#product_photo_zoom_url2").attr('onclick', picurl); $("a#product_photo_zoom_url2").attr('href', '#');

    Read the article

  • getting an onclick event to a select option using js

    - by Vadim.G
    i am having a very frustrating problem. I have this code which filters out my results and inputs them into a select box var syn = <?=json_encode($syn)?>; function filterByCity() { var e = document.getElementById("city_filter"); var city = e.options[e.selectedIndex].value; var selectOptions = document.getElementById('syn_list'); selectOptions.options.length = 0; for (i = 0; i < syn.length; i++) { if (city == syn[i]['city'] || city == 'all') { selectOptions.options[selectOptions.options.length] = new Option(syn[i]['name'], syn[i]['id'] + '" onclick="updateTxtContent(\'' + syn[i]['id'] + '\')'); } } } as you might see i am adding a onclick listener to every select "option" which look great in the source code of the page itself but if i copy it into an edit i notice this my problem is that the "updateTxtContent()" function is not called. <select size="10" name="syn_list" id="syn_list" class="span12" dir="rtl" style="text-align:right;"> <option value="13&quot; onclick=&quot;updateTxtContent('13')">option a</option> <option value="14&quot; onclick=&quot;updateTxtContent('14')">option b</option> obviously there should be a better way to do this that i am not aware of.

    Read the article

  • Escape apostrophe when passing parameter in onclick event

    - by RememberME
    I'm passing the company name to an onclick event. Some company names have apostrophes in them. I added '.Replace("'", "'")' to the company_name field. This allows the onclick event to fire, but the confirm message displays as "Jane's Welding Company". <a href="#" onclick="return Actionclick('<%= Url.Action("Activate", new {id = item.company_id}) %>', '<%= Html.Encode(item.company1.company_name.Replace("'", "&#39;")) %>');" class="fg-button fg-button-icon-solo ui-state-default ui-corner-all"><span class="ui-icon ui-icon-refresh"></span></a> <script type="text/javascript"> function Actionclick(url, companyName) { if (confirm('This action will activate this company\'s primary company ('+companyName+') and all of its other subsidiaries. Continue?')) { location.href = url; }; };

    Read the article

  • ASP.Net double-click problem

    - by David Archer
    Hi there, having a slight problem with an ASP.net page of mine. If a user were to double click on a "submit" button it will write to the database twice (i.e. carry out the 'onclick' method on the imagebutton twice) How can I make it so that if a user clicks on the imagebutton, just the imagebutton is disabled? I've tried: <asp:ImageButton runat="server" ID="VerifyStepContinue" ImageUrl=image src ToolTip="Go" TabIndex="98" CausesValidation="true" OnClick="methodName" OnClientClick="this.disabled = true;" /> But this OnClientClick property completely stops the page from being submitted! Any help? Sorry, yes, I do have Validation controls... hence the icky problem.

    Read the article

  • ASP.Net Count Download Clicks

    - by Marco
    Hello, I thought that this was easier… I have a asp:hyperlink control, with target=”_blank”, pointing to the file I want the user to download. My plan is to track the number of times, the users click on this link. I thought in placing it in ajax update panel, to catch the postback and avoid full page refresh. However, hyperlink doesn’t have a onClick method. On the other hand I could use a linkbutton, which has a onClick built in. But It’s harder to make the file open in a new window… and I would also have to do something like: Response.AppendHeader("Content-Disposition","attachment; filename=myImage.jpg"); But I heard that the above approach has some problems with PPT, PPTX, PPS, PPSX… What is you'r opinion on this? How and why, would you do it?

    Read the article

  • Click HTML except one element [ WITHOUT JQuery ]

    - by Tomirammstein
    I show us the code: (function (){ var element = document.getElementById('bar'), hideElement = document.getElementById('foo'), var html = document.getElementsByTagName('html')[0]; tool.onclick = function() { hideElement.style.display = 'block'; html.onclick = function() { hideElement.style.display = 'none'; } } })(); This piece of code work's fine, but, after clicking html, I can not reopen the hidden element. I want to click the html element and give display:none to hideElement, then to click the element id="bar", give to the hidden element display:block, but instead of click the element foo, click the html element. What I can do? Oh, i need help WITHOUT JQUERY, thanks :) EDIT: something like that : click on body except some other tag not working , but without JQuery,

    Read the article

  • Finding the closest grid coordinate to the mouse onclick with javascript/jQuery

    - by Acorn
    What I'm trying to do is make a grid of invisible coordinates on the page equally spaced. I then want a <div> to be placed at whatever grid coordinate is closest to the pointer when onclick is triggered. Here's the rough idea: I have the tracking of the mouse coordinates and the placing of the <div> worked out fine. What I'm stuck with is how to approach the problem of the grid of coordinates. First of all, should I have all my coordinates in an array which I then compare my onclick coordinate to? Or seeing as my grid coordinates follow a rule, could I do something like finding out which coordinate that is a multiple of whatever my spacing is is closest to the onclick coordinate? And then, where do I start with working out which grid point coordinate is closest? What's the best way of going about it? Thanks!

    Read the article

  • dynamically added radio buttons onclick event not working ?

    - by Anil Namde
    I am trying following, 1. Get response using Ajax from the users selection which returns me the list of the radio buttons attributes as 2. Once i get the attribute list i am creating the radio buttons using createElement() 3. Then i am attaching the event to the radio button for onclick buttons. 4. Then i add element to the DOM using appedChild The below is code for adding radio button (for IE) var radio = '<input '; radio += 'type ="radio" '; radio += 'id="' + id + '" '; radio += 'value="" '; radio += '/>'; radioButton = document.createElement(radio); radioButton.onClick = function(){alert('this is test')} ele.appendChild(radioButton); ele.innerHTML += 'none' + '<br/>'; Now in all this when i am adding the radio button to the DOM onclick is not working and i don't understand why ? Thanks all

    Read the article

  • Change the value of an existing onclick function

    - by Mark Peach
    I have a page that is pulling in via an iframe a page of html content from a pre-existing content management system, whose content I can not directly change. I want to use jquery to alter some of the links and button locations dynamically. For links within the page I was able to change the href attr values of <a href="/content.asp">more</a> from content.asp to content2.asp using $("a[href^='/content.asp']") .each(function() { this.href = this.href.replace("content.asp", "content2.asp"); }); But the page pulled in also has form buttons that contains javascript onclick functions e.g. <INPUT type="button" value="Add to basket" onClick="document.location='/shopping-basket.asp?mode=add&id_Product=1076';"> I basically want to use jquery to select any such buttons and change the shopping-basket.asp to shopping-basket2.asp How can I select these buttons/onclick functions and change the location string?

    Read the article

  • Image input onclick event being fired when enter button Pressed

    - by Anthony
    I have a strange problem where an onclick event on an input image is being fired when i hit enter in input text box <form id="MyForm" action="/someaction"> <input type="image" src="someimage.jpg" onclick="doStuff();$('#MyForm').submit();" /> <input type="text" name="textInput"/> </form> When the cursor is in the text box and i hit enter, rather than the form being submitted it calls the onclick event on the image input. Any ideas whats going on ?

    Read the article

  • Server-side Javascript (aspx.cs) Attributes.Add Code to Change a Label's text

    - by DFM
    I am trying to change a label's text by using server-side javascript (onclick) and C# within the page_load event. For example, I would like to write something like the following: Label1.Attributes.Add("onclick", "Label2.text='new caption'") Does anyone know the correct code for this? Also, what is this type of code referred to; is it just javascript or javascript in C# or is there a specific name? Lastly, does a book or online resource exist that lists the choices of control.attributes.add("event", "syntax") code to use with C#? Thank you, DFM

    Read the article

  • Drupal removing javascript from Full HTML link

    - by Jen
    I am new to Drupal and am trying to create a node (let's call it child) that will only really be accessed when clicked on from another node (we'll call it parent). When closing the child window, I want to parent window to refresh. Outside of Drupal, that's easy: <a onclick="window.close(); window.opener.location.reload();" href="#">Click to close this window</a> However, when I type this into the body of a node using Full HTML, it still strips the onclick text from my post. How can I include javascript in the body of a node like this? Is there a special module I need. Thanks!

    Read the article

  • send variable fancybox onclick event

    - by samuel saul
    hi, i want to send href value. but its not working. function display () { $.fancybox({ 'href': 'index.php', 'width' : '75%', 'height' : '75%', 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'iframe' }); } i tryed this : function display (who) { $.fancybox({ 'href': 'index.php'+who, 'width' : '75%', 'height' : '75%', 'autoScale' : false, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'iframe' }); } <a onclick="javascript:display("?id=11");" href="#" >create</a> this onclick event inside the innerhtml so its not working with '' why

    Read the article

  • Function this parameter on onclick

    - by Jerome
    I've some html code generated in javascript like this cell.innerHTML = '<a href="#" class="sortheader" id="sortheader_'+i+'" '+ 'onclick="ts_resortTable(this, '+i+');return false;">' + txt+'<span class="sortarrow"></span></a>'; I'd like to call the function ts_resortTable() but independently of the onclick event how can i generate the "this" parameter of the function? I tried the DOM selector : $('sortheader_'+i) in jQuery and the getElementById('#sortheader_'+i) as well but it's not working

    Read the article

  • Android beginner: Touch events in android gridview

    - by jja
    I am using the following code to do things with gridview(slightly modified from http://developer.android.com/resources/tutorials/views/hello-gridview.html). I want to replace the onClicklistener and the onClick() method with their "touch" equivalents i.e. touchlistener and onTouch() so that when i touch an element in the gridview the image of the element changes and a double touch on the same element takes it back to the orginal state. How do I do this? I can't get my code to do this. The clicklistener works to some extent but the touch isn't. Please help. public class ImageAdapter extends BaseAdapter { private Context mContext; public ImageAdapter(Context c) { mContext = c; } public int getCount() { return mThumbIds.length; } public Object getItem(int position) { return null; } public long getItemId(int position) { return 0; } // create a new ImageView for each item referenced by the Adapter public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { // if it's not recycled, initialize some attributes imageView = new ImageView(mContext); imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(8, 8, 8, 8); imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(position==0) { //do this } else { //do this } } }); } else { imageView = (ImageView) convertView; } imageView.setImageResource(mThumbIds[position]); return imageView; } // references to our images private Integer[] mThumbIds = { R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7, R.drawable.sample_0, R.drawable.sample_1, R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7, R.drawable.sample_0, R.drawable.sample_1, R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7 }; }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >