Search Results

Search found 13401 results on 537 pages for 'double checked'.

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

  • Using CompareTo() on different .NET types (e.g. int vs. double)

    - by Yossin
    Hi, I've got a static method that accepts two object type variables and runs the CompareTo() method: public static int Compare(Object objA, Object objB) { return (((IComparable)objA).CompareTo(objB)); } Problem is that CompareTo() throws an exception when trying to compare between different types (e.g. int and double). Does any one know of a better way in C#, to compare between two different types? Or a workaround to this problem? Thanks

    Read the article

  • Desktop switcher appears to be broken for quick double-switches

    - by Jon Blackburn
    I'm wondering if anyone else has seen this. I have three virtual desktops aligned in a horizontal row. In the middle desktop I have only a single application window. I have keyboard shortcuts mapping to navigate between the desktops. Obviously, I never use the up/down arrows because I only have one row of workspaces. Here's the problem, which only started to happen after I installed 12.04.1: When I rapidly hit to go from workspace 1 to workspace 3, the window on workspace 2 gets moved to workspace 1. I have checked using both Unity and Gnome3, and the behavior is the same under both. If I change back to the default workspace setup (a 2x2 grid of desktops) things seem to settle down (i.e., no wandering windows). Not every type of application window behaves the same way. I couldn't get a Chrome browser to jump from 2 to 1, but both Terminal and Terminator exhibit the behavior. Any thoughts? Better workarounds? Thanks in advance.

    Read the article

  • Open the LOV of af:inputListOfValues with a double click

    - by frank.nimphius
    To open the LOV popup of an af:inputListOfValues component in ADF Faces, you either click the magnifier icon to the right of the input field or tab onto the icon and press the Enter key. If you want to open the same dialog in response to a user double click into the LOV input field, JavaScript is a friend. For this solution, I assume you created an editable table or input form that is based on a View Object that contains at least one attribute that has a model driven list of values defined. The Default List Type is should be set to Input Text with List of Values so that when the form or table gets created, the attribute is rendered by the af:inputListOfValues component. To implement the use case, drag a Client Listener component from the Operations accordion in the Component Palette and drop it onto the af:inputListOfValues component in the page. In the opened Insert Client Listener dialog, define the Method as handleLovOnDblclickand choose dblClick in the select list for the Type attribute. Add the following code snippet to the page source directly below the af:document tag. <af:document id="d1">      <af:resource type="javascript">     function handleLovOnDblclick(evt){             var lovComp = evt.getSource();             if (lovComp instanceof AdfRichInputListOfValues &&          lovComp.getReadOnly()==false){           AdfLaunchPopupEvent.queue(lovComp,true);        }     }      </af:resource> The JavaScript function is called whenever the user clicks into the LOV field. It gets the source component reference from the event object that is passed into the function and verifies the LOV component is not read only. It then queues the launch event for the LOV popup to open. The page source for the LOV component is shown below: <af:inputListOfValues id="departmentIdId" … >   <f:validator binding="…"/>   …  <af:clientListener method="handleLovOnDblclick" type="dblClick"/> </af:inputListOfValues>

    Read the article

  • Precision of cos(atan2(y,x)) versus using complex <double>, C++

    - by Ivan
    Hi all, I'm writing some coordinate transformations (more specifically the Joukoswky Transform, Wikipedia Joukowsky Transform), and I'm interested in performance, but of course precision. I'm trying to do the coordinate transformations in two ways: 1) Calculating the real and complex parts in separate, using double precision, as below: double r2 = chi.x*chi.x + chi.y*chi.y; //double sq = pow(r2,-0.5*n) + pow(r2,0.5*n); //slow!!! double sq = sqrt(r2); //way faster! double co = cos(atan2(chi.y,chi.x)); double si = sin(atan2(chi.y,chi.x)); Z.x = 0.5*(co*sq + co/sq); Z.y = 0.5*si*sq; where chi and Z are simple structures with double x and y as members. 2) Using complex : Z = 0.5 * (chi + (1.0 / chi)); Where Z and chi are complex . There interesting part is that indeed the case 1) is faster (about 20%), but the precision is bad, giving error in the third decimal number after the comma after the inverse transform, while the complex gives back the exact number. So, the problem is on the cos(atan2), sin(atan2)? But if it is, how the complex handles that? Thanks!

    Read the article

  • [Netbeans 6.9] Java MethodOverloading error with double values

    - by Nimitips
    Here is a part of my code I'm having trouble with: ===Class Overload=== public class Overload { public void testOverLoadeds() { System.out.printf("Square of integer 7 is %d\n",square(7)); System.out.printf("Square of double 7.5 is %d\n",square(7.5)); }//..end testOverloadeds public int square(int intValue) { System.out. printf("\nCalled square with int argument: %d\n",intValue); return intValue * intValue; }//..end square int public double square(double doubleValue) { System.out.printf("\nCalled square with double argument: %d\n", doubleValue); return doubleValue * doubleValue; }//..end square double }//..end class overload ===Main=== public static void main(String[] args) { Overload methodOverload = new Overload(); methodOverload.testOverLoadeds(); } It compiles with no error, however when I try to run it the output is: Called square with int argument: 7 Square of integer 7 is 49 Exception in thread "main" java.util.IllegalFormatConversionException: d != java.lang.Double at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:3999) at java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2709) at java.util.Formatter$FormatSpecifier.print(Formatter.java:2661) at java.util.Formatter.format(Formatter.java:2433) at java.io.PrintStream.format(PrintStream.java:920) at java.io.PrintStream.printf(PrintStream.java:821) at methodoverload.Overload.square(Overload.java:19) at methodoverload.Overload.testOverLoadeds(Overload.java:8) at methodoverload.Main.main(Main.java:9) Called square with double argument:Java Result: 1 What am I doing wrong? I'm on Ubuntu 10.10, Netbeans 6.9. Thanks.

    Read the article

  • Mistake in display and insert methods (double-ended queue)

    - by MANAL
    1) My problem when i make remove from right or left program will be remove true but when i call diplay method the content wrong like this I insert 12 43 65 23 and when make remove from left program will remove 12 but when call display method show like this 12 43 65 and when make remove from right program will remove 23 but when call display method show like this 12 43 Why ?????? ); and when i try to make insert after remove write this Can not insert right because the queue is full . first remove right and then u can insert right where is the problem ?? Please Help me please 2) My code FIRST CLASS class dqueue { private int fullsize; //number of all cells private int item_num; // number of busy cells only private int front,rear; public int j; private double [] dqarr; //========================================== public dqueue(int s) //constructor { fullsize = s; front = 0; rear = -1; item_num = 0; dqarr = new double[fullsize]; } //========================================== public void insert(double data) { if (rear == fullsize-1) rear = -1; rear++; dqarr[rear] = data; item_num++; } public double removeLeft() // take item from front of queue { double temp = dqarr[front++]; // get value and incr front if(front == fullsize) front = 0; item_num --; // one less item return temp; } public double removeRight() // take item from rear of queue { double temp = dqarr[rear--]; // get value and decr rear if(rear == -1) // rear = item_num -1; item_num --; // one less item return temp; } //========================================= public void display () //display items { for (int j=0;j<item_num;j++) // for every element System.out.print(dqarr[j] +" " ); // display it System.out.println(""); } //========================================= public int size() //number of items in queue { return item_num; } //========================================== public boolean isEmpty() // true if queue is empty { return (item_num ==0); } } SECOND CLASS import java.util.Scanner; class dqueuetest { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println(" ***** Welcome here***** "); System.out.println(" ***** Mind Of Programming Group***** "); System.out.println(" _____________________________________________ "); System.out.println("enter size of your dqueue"); int size = input.nextInt(); dqueue mydq = new dqueue(size); System.out.println(""); System.out.println("enter your itemes"); //===================================== for(int i = 0;i<=size-1;i++) { System.out.printf("item %d:",i+1); double item = input.nextDouble(); mydq.insert(item); System.out.println(""); } //===================================== int queue =size ; int c = 0 ; while (c != 6) { System.out.println(""); System.out.println("************************************************"); System.out.println(" MAIN MENUE"); System.out.println("1- INSERT RIGHT "); System.out.println("2- REMOVE LEFT"); System.out.println("3- REMOVE RIGHT"); System.out.println("4- DISPLAY"); System.out.println("5- SIZE"); System.out.println("6- EXIT"); System.out.println("************************************************"); System.out.println("choose your operation by number(1-6)"); c = input.nextInt(); switch (c) { case 1: if (queue == size) System.out.print("Can not insert right because the queue is full . first remove right and then u can insert right "); else { System.out.print("enter your item: "); double item = input.nextDouble(); mydq.insert(item);} break; case 2: System.out.println("REMOVE FROM REAR :"); if( !mydq.isEmpty() ) { double item = mydq.removeLeft(); System.out.print(item + "\t"); } // end while System.out.println(""); mydq.display(); break; case 3: System.out.println("REMOVE FROM FRONT :"); if( !mydq.isEmpty() ) { double item = mydq.removeRight(); System.out.print(item + "\t"); } // end while System.out.println(""); mydq.display(); break; case 4: System.out.println("The items in Queue are :"); mydq.display(); break; case 5: System.out.println("The Size of the Queue is :"+mydq.size()); break; case 6: System.out.println("Good Bye"); break; default: System.out.println("wrong chiose enter again"); } //end switch } //end while } // end main }//end class

    Read the article

  • Mistake in dispaly and insert method (double - ended queue)

    - by MANAL
    1) My problem when i make remove from right or left program will be remove true but when i call diplay method the content wrong like this I insert 12 43 65 23 and when make remove from left program will remove 12 but when call display method show like this 12 43 65 and when make remove from right program will remove 23 but when call display method show like this 12 43 Why ?????? ); and when i try to make insert after remove write this Can not insert right because the queue is full . first remove right and then u can insert right where is the problem ?? Please Help me please 2) My code FIRST CLASS class dqueue { private int fullsize; //number of all cells private int item_num; // number of busy cells only private int front,rear; public int j; private double [] dqarr; //========================================== public dqueue(int s) //constructor { fullsize = s; front = 0; rear = -1; item_num = 0; dqarr = new double[fullsize]; } //========================================== public void insert(double data) { if (rear == fullsize-1) rear = -1; rear++; dqarr[rear] = data; item_num++; } public double removeLeft() // take item from front of queue { double temp = dqarr[front++]; // get value and incr front if(front == fullsize) front = 0; item_num --; // one less item return temp; } public double removeRight() // take item from rear of queue { double temp = dqarr[rear--]; // get value and decr rear if(rear == -1) // rear = item_num -1; item_num --; // one less item return temp; } //========================================= public void display () //display items { for (int j=0;j //========================================= public int size() //number of items in queue { return item_num; } //========================================== public boolean isEmpty() // true if queue is empty { return (item_num ==0); } } SECOND CLASS import java.util.Scanner; class dqueuetest { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println(" Welcome here** "); System.out.println(" * Mind Of Programming Group*** "); System.out.println(" _________________________ "); System.out.println("enter size of your dqueue"); int size = input.nextInt(); dqueue mydq = new dqueue(size); System.out.println(""); System.out.println("enter your itemes"); //===================================== for(int i = 0;i<=size-1;i++) { System.out.printf("item %d:",i+1); double item = input.nextDouble(); mydq.insert(item); System.out.println(""); } //===================================== int queue =size ; int c = 0 ; while (c != 6) { System.out.println(""); System.out.println("**************************"); System.out.println(" MAIN MENUE"); System.out.println("1- INSERT RIGHT "); System.out.println("2- REMOVE LEFT"); System.out.println("3- REMOVE RIGHT"); System.out.println("4- DISPLAY"); System.out.println("5- SIZE"); System.out.println("6- EXIT"); System.out.println("**************************"); System.out.println("choose your operation by number(1-6)"); c = input.nextInt(); switch (c) { case 1: if (queue == size) System.out.print("Can not insert right because the queue is full . first remove right and then u can insert right "); else { System.out.print("enter your item: "); double item = input.nextDouble(); mydq.insert(item);} break; case 2: System.out.println("REMOVE FROM REAR :"); if( !mydq.isEmpty() ) { double item = mydq.removeLeft(); System.out.print(item + "\t"); } // end while System.out.println(""); mydq.display(); break; case 3: System.out.println("REMOVE FROM FRONT :"); if( !mydq.isEmpty() ) { double item = mydq.removeRight(); System.out.print(item + "\t"); } // end while System.out.println(""); mydq.display(); break; case 4: System.out.println("The items in Queue are :"); mydq.display(); break; case 5: System.out.println("The Size of the Queue is :"+mydq.size()); break; case 6: System.out.println("Good Bye"); break; default: System.out.println("wrong chiose enter again"); } //end switch } //end while } // end main }//end class

    Read the article

  • WinForms (C#) Databinding Object to Checkbox.Checked Property

    - by Trevor Sullivan
    Hello, I'm writing a WinForms app, and am trying to bind a boolean property on a .NET object to a Checkbox's "checked" property. I am successfully creating the binding, but when I change the source property's value from false to true (I have a button that toggles it), the checkbox's "checked" property does not reflect that change. if (chkPreRun.DataBindings["Checked"] == null) { Debug.WriteLine("Adding chkPreRun databinding"); Binding _binding = chkPreRun.DataBindings.Add("Checked", NwmConfig, "PreRun") // Added this just to ensure that these were being set properly _binding.DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged; _binding.ControlUpdateMode = ControlUpdateMode.OnPropertyChanged; } I am able to successfully bind the text property to the value of a TextBox, for example. I'm not sure what I'm missing while binding to the "Checked" property, however. Cheers, Trevor

    Read the article

  • Change Check Out Folder for checked out files in SourceSafe

    - by Town
    I had to rebuild my machine and went from XP to Windows 7. I've now got a bit of an issue: I had files checked out in SourceSafe previously, which I still have copies of in the local folder on my new install. However, SourceSafe still has them checked out to the old XP folder (c:\documents and settings etc) whereas the files now reside in c:\Users. Pending Checkins in Visual Studio now thinks I have nothing checked out, and SourceSafe declares that the files are checked out to me under the c:\documents and settings\ path. Is there any way to tell SourceSafe to simply "look over there" for the files instead? It seems to work with individually undoing and redoing checkout on the files, but that's a lengthy process and one I'd like to avoid if possible. If I simply checkout the files individually then it lists them as checked out to me twice, one for each of the locations. Any pointers would be very much appreciated!

    Read the article

  • jquery checked checkbox IE problem

    - by lidermin
    Hi, I'm having an issue verifying if a checkbox is checked using jquery on Internet Explorer. This is the code I'm using: if ($('#chkjq_1').attr('checked') == true) It works fine on Firefox or Chrome, but on Internet Explorer 7, the condition is always false because the browser sets the property this way: <input id="chkjq_1" type="checkbox" CHECKED/> IE7 And the right way is the following: (Firefox, Chrome): <input id="chkjq_1" type="checkbox" checked="checked"/> FF, Chrome, etc What should I do to avoid this issue on Internet Explorer 7; is there a generic way in jquery to solve this? Thanks in advance.

    Read the article

  • jQuery if checkbox is checked to toggle classes

    - by Lynx
    I am needed to change my jQuery code up. Instead of the label toggling the class and showing the icon I need it to where if the checkbox is checked to show to toggle those classes. I have tried prop and is but I couldn't get them to work properly. The reason for the change is I want to preload data into the form and if it's going to be checked those toggles need to reflect that change. http://jsfiddle.net/70fbLooL/2/ EDIT Seems to be confusion as to exactly what I am trying to do. The fiddle I provided works perfectly fine. The problem is if I want to call the form from server-side and pre-populate the form the checkbox toggles will not show that they are checked because it's based on the clicked function. I need it to be based on if the checkbox equal true or checked. That way if the value equals true from the server-side call it will toggle those classes and look like it's checked.

    Read the article

  • Escaping '“' with regular double quotes using Ruby regex

    - by DavidP6
    I have text that has these fancy double quotes: '“' and I would like to replace them with regular double quotes using Ruby gsub and regex. Here's an example and what I have so far: sentence = 'This is a quote, “Hey guys!”' I couldn't figure out how to escape double quotes so I tried using 34.chr: sentence.gsub("“",34.chr). This gets me close but leaves a back slash in front of the double quote: sentence.gsub("“",34.chr) => 'This is a quote, \"Hey guys!”'

    Read the article

  • iphone - double tap fail safe way

    - by mike
    I am trying to detect double taps on a view, but when the double tap comes, the first tap triggers an action on TouchesBegan, so, before detecting a double tap a single tap is always detected first. How can I make this in a way that just detects the double tap? I cannot use OS 3.x gestures, because I have to make it compatible with old OS versions. thanks

    Read the article

  • How is IObservable<double>.Average supposed to work?

    - by Dan Tao
    Update Looks like Jon Skeet was right (big surprise!) and the issue was with my assumption about the Average extension providing a continuous average (it doesn't). For the behavior I'm after, I wrote a simple ContinuousAverage extension method, the implementation of which I am including here for the benefit of others who may want something similar: public static class ObservableExtensions { private class ContinuousAverager { private double _mean; private long _count; public ContinuousAverager() { _mean = 0.0; _count = 0L; } // undecided whether this method needs to be made thread-safe or not // seems that ought to be the responsibility of the IObservable (?) public double Add(double value) { double delta = value - _mean; _mean += (delta / (double)(++_count)); return _mean; } } public static IObservable<double> ContinousAverage(this IObservable<double> source) { var averager = new ContinuousAverager(); return source.Select(x => averager.Add(x)); } } I'm thinking of going ahead and doing something like the above for the other obvious candidates as well -- so, ContinuousCount, ContinuousSum, ContinuousMin, ContinuousMax ... perhaps ContinuousVariance and ContinuousStandardDeviation as well? Any thoughts on that? Original Question I use Rx Extensions a little bit here and there, and feel I've got the basic ideas down. Now here's something odd: I was under the impression that if I wrote this: var ticks = Observable.FromEvent<QuoteEventArgs>(MarketDataProvider, "MarketTick"); var bids = ticks .Where(e => e.EventArgs.Quote.HasBid) .Select(e => e.EventArgs.Quote.Bid); var bidsSubscription = bids.Subscribe( b => Console.WriteLine("Bid: {0}", b) ); var avgOfBids = bids.Average(); var avgOfBidsSubscription = avgOfBids.Subscribe( b => Console.WriteLine("Avg Bid: {0}", b) ); I would get two IObservable<double> objects (bids and avgOfBids); one would basically be a stream of all the market bids from my MarketDataProvider, the other would be a stream of the average of these bids. So something like this: Bid Avg Bid 1 1 2 1.5 1 1.33 2 1.5 It seems that my avgOfBids object isn't doing anything. What am I missing? I think I've probably misunderstood what Average is actually supposed to do. (This also seems to be the case for all of the aggregate-like extension methods on IObservable<T> -- e.g., Max, Count, etc.)

    Read the article

  • Distinguish between single and double click events in Qt

    - by Jesse
    I have a QAbstractItemView that needs to react to single and double click events. The actions are different depending on whether it was single clicked or double clicked. The problem that is occurring is that the single click event is received prior to the double click event. Is there a recommended way/best practice for distinguishing between the two? I don't want to perform the single click action when the user has actually double clicked. I am using Qt 4.6

    Read the article

  • How to make double[,] x_List in C#3.0?

    - by Newbie
    I ned to implement the multi-linear regression in C#(3.0) by using the LinESt function of Excel. Basically I am trying to achieve =LINEST(ACL_returns!I2:I10,ACL_returns!J2:K10,FALSE,TRUE) So I have the data as below double[] x1 = new double[] { 0.0330, -0.6463, 0.1226, -0.3304, 0.4764, -0.4159, 0.4209, -0.4070, -0.2090 }; double[] x2 = new double[] { -0.2718, -0.2240, -0.1275, -0.0810, 0.0349, -0.5067, 0.0094, -0.4404, -0.1212 }; double[] y = new double[] { 0.4807, -3.7070, -4.5582, -11.2126, -0.7733, 3.7269, 2.7672, 8.3333, 4.7023 }; I have to write a function whose signature will be Compute(double[,] x_List, double[] y_List) { LinEst(x_List,y_List, true, true); < - This is the excel function that I will call. } My question is how by using double[] x1 and double[] x2 I will make double[,] x_List ? I am using C#3.0 and framework 3.5. Thanks in advance

    Read the article

  • building jquery checkbox - can't set checked value

    - by benpage
    this seems straightforward enough, I don't know if it's a bug, or just something I'm doing wrong. What I want to do is build a checkbox input in jquery, then return the string of the input. I have this code: var obj = $('<input>'); obj.attr('disabled', 'disabled'); obj.attr('type', 'checkbox'); obj.attr('checked', 'checked'); // this does not work! no matter how i try to render this obj, the 'checked' attribute never gets outputted. So I have tried: $('<div>').append(obj).remove().html(); and it returns: <input type="checkbox" disabled="disabled" /> I have tried setting an id attribute, it makes no difference. I have also tried this but it doesn't work: obj.attr('checked', true); Any suggestions on how to get the input tag rendered with the checked attribute set to 'checked' (via jquery)? I realise I can just do this with string concatenation, but now I really want to know why it's not working the way it should.

    Read the article

  • MVVM-Light EventToCommand Behavior for CheckBox Checked/Unchecked in Silverlight

    - by George Durzi
    I would like to handle the Checked and Unchecked events of a Checkbox control and execute a command in my ViewModel. I wired up an EventTrigger for both the Checked and Unchecked events as follows: <CheckBox x:Name="chkIsExtendedHr" IsChecked="{Binding Schedule.Is24Hour, Mode=TwoWay}"> <i:Interaction.Triggers> <i:EventTrigger EventName="Checked"> <GalaSoft_MvvmLight_Command:EventToCommand CommandParameter="{Binding IsChecked, ElementName=chkIsExtendedHr}" Command="{Binding Path=SetCloseTime, Mode=OneWay}" /> </i:EventTrigger> <i:EventTrigger EventName="Unchecked"> <GalaSoft_MvvmLight_Command:EventToCommand CommandParameter="{Binding IsChecked, ElementName=chkIsExtendedHr}" Command="{Binding Path=SetCloseTime, Mode=OneWay}" /> </i:EventTrigger> </i:Interaction.Triggers> </CheckBox> I defined a RelayCommand in my ViewModel and wired up an action for it: public RelayCommand<Boolean> SetCloseTime{ get; private set; } ... SetCloseTime= new RelayCommand<bool>(ExecuteSetCloseTime); The parameter in the action for the command always resolves to the previous state of the CheckBox, e.g. false when the CheckBox is checked, and true when the CheckBox is unchecked. void ExecuteSetCloseTime(bool isChecked) { if (isChecked) { // do something } } Is this expected behavior? I have a workaround where I have separate triggers (and commands) for the Checked and Unchecked and use a RelayCommand instead of RelayCommand<bool>. Each command executes correctly when the CheckBox is checked and unchecked. Feels a little dirty though - even dirtier than having UI code in my ViewModel :) Thanks

    Read the article

  • radiobutton checked on condition in jquery

    - by RememberME
    I have the following fields: <label>Company Type:</label> <label for="primary"><input onclick="javascript: $('#sec').hide('slow');$('#primary_company').find('option:first').attr('selected','selected');" type="radio" runat="server" name="companyType" id="primary" />Primary</label> <label for="secondary"><input onclick="javascript: $('#sec').show('slow');" type="radio" runat="server" name="companyType" id="secondary" />Secondary</label> <div id="sec"> <fieldset> <label for="primary_company">Primary Company:</label> <%= Html.DropDownList("primary_company", Model.SelectPrimaryCompanies, "** Select Primary Company **") %> </fieldset> If there is a primary_company, then the secondary radio button should be selected. If there is no primary_company, then the primary radio button should be selected. Here is my jQuery: $(document).ready(function() { if ($('#primary_company').val().length > 0) { $('#secondary').attr({ checked: true }); } else { $("#primary").attr('checked', true ); $('#sec').hide(); } The sec div hides and shows properly, but a radio button is never selected. I've tried .attr('checked', 'checked') and .attr({ checked: true }) and .attr('checked', true) but nothing is ever selected.

    Read the article

  • How Do i handle both the checked and clicked events in Jquery

    - by Someone
    Say I have a form and onload of that form I have 2 radio buttons say "yes" or "no " I have set of action to perform when we select either one radio button .Say if we select "yes " //Onload of Form if(("#yes:checked")){ $("#table").show(); $("#div1").show(); $("#div2").show(); alert("Checkedd on Load"); } //for click $("#yes").bind('click',function(){ $("#table").show(); $("#div1").show(); $("#div2").show(); alert("Checked by Click"); }); }); Iam Writing the same repeated lines of code for two similar set of events .Is There anyway to combine the "Checked" and "Clicked" events Say if i do inthis way than "Checked" doesnot get called untill "Clicked"?Is there any other way to do it. $("#yes").bind('click',function(){ if(("#yes:checked")){ $("#table").show(); $("#div1").show(); $("#div2").show(); alert("Checked by Click"); } }); });

    Read the article

  • checking all checkboxes are checked using jquery

    - by kumar
    Hello friends I have two button one is SelectAll then MassEdit.. my code for select all is $('#btnAll').click(function() { $('#ExceptionDetails input[type=checkbox]').attr('checked', 'checked'); }); this check all the chekcboxes in my view.. then I have other button code which needs to take only checked checkbox information to send it other page.. to display only checked checkbox users.. $('#btnMassEdit').click(function() { $('#ExceptionDetails input[type=checkbox]').each(function() { if ($(this).attr('checked')) { $('#specialist-tab').tabs('url', 3, '<%=Url.Action("getmasseditexceptions", "Expense", new { @GUI_SPEC_STAT_DSPL = GUI_SPEC_STAT_DSPL, @C_EXCPT_CATG = C_EXCPT_CATG, @C_EXCPT_TYPE = C_EXCPT_TYPE })%>').tabs('enable', 3).tabs('select', 3); return false; } else { alert("please select atleast one exceptin"); $().ShowDialog('Please Select Exception, Select atleast one exception'); return false; } }); }); i have a fieldset which is ExceptionDetails..one field set have only one checkbox.. but my view having multiple fieldsets for differnt exceptions.. I need to check all the filedsset which is checked or not what ever the fieldset checkboxes are check I need to take only that exception to pass to the other page.. thanks

    Read the article

  • Why doesn't my form post when I disable the submit button to prevent double clicking?

    - by John MacIntyre
    Like every other web developer on the planet, I have an issue with users double clicking the submit button on my forms. My understanding is that the conventional way to handle this issue, is to disable the button immediately after the first click, however when I do this, it doesn't post. I did do some research on this, god knows there's enough information, but other questions like Disable button on form submission, disabling the button appears to work. The original poster of Disable button after submit appears to have had the same problem as me, but there is no mention on how/if he resolved it. Here's some code on how to repeat it (tested in IE8 Beta2, but had same problem in IE7) My aspx code <%@ Page Language="C#" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!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"> <script language="javascript" type="text/javascript"> function btn_onClick() { var chk = document.getElementById("chk"); if(chk.checked) { var btn = document.getElementById("btn"); btn.disabled = true; } } </script> <body> <form id="form1" runat="server"> <asp:Literal ID="lit" Text="--:--:--" runat="server" /> <br /> <asp:Button ID="btn" Text="Submit" runat="server" /> <br /> <input type="checkbox" id="chk" />Disable button on first click </form> </body> </html> My cs code using System; public partial class _Default : System.Web.UI.Page { protected override void OnInit(EventArgs e) { base.OnInit(e); btn.Click += new EventHandler(btn_Click); btn.OnClientClick = "btn_onClick();"; } void btn_Click(object sender, EventArgs e) { lit.Text = DateTime.Now.ToString("HH:mm:ss"); } } Notice that when you click the button, a postback occurs, and the time is updated. But when you check the check box, the next time you click the button, the button is disabled (as expected), but never does the postback. WHAT THE HECK AM I MISSING HERE??? Thanks in advance.

    Read the article

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