Search Results

Search found 4289 results on 172 pages for 'focus stealing'.

Page 147/172 | < Previous Page | 143 144 145 146 147 148 149 150 151 152 153 154  | Next Page >

  • Organizing development teams

    - by Patrick
    A long time ago, when my company was much smaller, dividing the development work over teams was quite easy: the 'application' team developed the applications-specific logic, often requiring a deep insight of specific industry problems) the 'generic' team developed the parts that were common/generic for all applications (user interface related stuff, database access, low-level Windows stuff, ...) Over the years the boundaries between the teams have become fuzzy: the 'application' teams often write application-specific functionality with a 'generic' part, so instead of asking the 'generic' team to write that part for them, they write it themselves to speed up the developments; then donate it to the 'generic' team the 'generic' team's focus seems to be more 'maintenance oriented'. All of the 'very generic' code has already been written, so no new developments are needed in it, but instead they continuously have to support all the functionality donated by the application teams. All this seems to indicate that it's not a good idea anymore to have this split in teams. Maybe the 'generic' team should evolve into a 'software quality' team (defining and guarding the rules for writing good quality software), or into a 'software deployment' team (defining how software should be deployed, installed, ...). How do you split up the work in different teams if you have different applications? everybody can write generic code and donates it to a central 'generic' team? everybody can write generic code, but nobody 'manages' this generic code (everybody is the owner) generic code is written by a 'generic' team only and the applications have to wait until the 'generic' team delivers the generic part (via a library, via a DLL) there is no overlap in code between the different applications some other way? Notice that thee advantage of having the mix (allowing everybody to write everywhere in the code) is that: code is written in a more flexible way it's easier to debug the code since you can easily step into the 'generic' code in the debugger But the big (and maybe only) disadvantage is that this generic code may become nobody's responsibility if there is no clear team that manages it anymore. What is your vision?

    Read the article

  • password is auto-completed despite setting redisplay=false in JSP (Struts)

    - by lmcgowin
    So I have a web application on Tomcat, built on top of Struts 1.1. Here is a snippet of my JSP, it's a login. <html:form action = "LoginAction" focus = "username"> <table> <tr><td align = "right">User name: </td> <td><html:text property = "username"/> </td></tr> <tr><td align = "right">Password: </td><td><html:password property = "password" redisplay = "false"/></td></tr> </table> </html:form> Snippet from struts-html-1.1.tld: <tag> <name>password</name> <tagclass>org.apache.struts.taglib.html.PasswordTag</tagclass> <attribute> <name>redisplay</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> Resulting HTML: Having trouble getting this to post as code but the relevant part is an input tag of type 'password' with no reference to redisplay, autocomplete, etc. It is my understanding that the redisplay element should be passed through Struts to appear in the HTML.

    Read the article

  • Keyboard not dismissed

    - by sgosha
    I am developing a messaging application that have SMS.app-like UI. Conversation screen has text input field at the bottom which is moved up with keyboard. Tapping on conversation area dismisses keyboard by calling resignFirstResponder method on UITextView that we use. This usually works fine, but users report a weird bug which I can't reproduce and fix. People say that sometimes onscreen keyboard doesn't go away when they tap on conversation area, though text input field loses input focus. Once the view enters that abnormal state users are able to type with keyboard, but text that is being entered is not visible anywhere. This bug happens in one of conversation views and since then no one text input field in other views doesn't work as expected. The only way to stop this weird behavior is killing application from multitasking bar. Even more weird thing is that keyboard stays visible while navigating between view controllers in UINavigationController. I noticed two things: - if tap on ' Anyone else experiencing same problems. Any ideas on what may cause this bug?

    Read the article

  • Why is my content being overwritten instead of replaced in jQuery/Ajax?

    - by Matt Nathanson
    I've got jquery being used in ajax to pass some contents into a database, my problem however has nothing to do with the db.. I have input fields in an id called #clientscontainer. When I click "save" in that container, it automatically refreshes the container correctly ... $('#clientscontainer').html(html); The problem is, a couple of those input fields (such as a description and title), have instances in another div that i want to refresh upon the save click. The other ID is: $('div#' + clientID') When I do $('div#' + clientID').html(html); it refreshes the content from clientscontainer in it instead of just the variables that I want to update. When I try to pass just the variable $(blurb).html(html); it updates the blurb but it ONLY displays that variable in the div# clientID div... whereas I just want to replace it. Here is the AJAX portion of the function ...//variables// dataToLoad = 'clientID=' + clientID + '&changeClient=yes' + '&project=' + descriptionSubTitle + '&campaign=' + descriptionTitle + '&label=' + descriptionLabel + '&descriptionedit=' + description + '&blurbedit=' + blurb; $.ajax({ type: 'post', url: ('/clients/controller.php'), datatype: 'html', data: dataToLoad, success: function(html){ dataToLoad = 'clientID=' + clientID + '&loadclient=yes&isCMS=' + editCMS; $.ajax({ type: 'post', url: '/clients/controller.php', datatype: 'html', data: dataToLoad, async: false, success: function(html){ //$('#clientscontainer').focus(function() {reInitialize()}); //$('#clientscontainer').ajaxComplete(function(){reInitialize()}); $('#clientscontainer').html(html); $('div#' + clientID).each(function(){ $('#editbutton').click(function() {EditEverything()}); } , error: function() { alert('An error occured! 222'); } });}, error: function() { alert('An error occured! 394'); } }); any suggestions?

    Read the article

  • javascript style.visibility doesn't seem to work....

    - by Pandiya Chendur
    In my aspx page i have a tr which is set visible="false" by default... But on a selected index of a dropdown i make it visible="true" ..... On the form submit i am validating the control within the tr but couldn't find whether the tr is visinle or not using javascript... My aspx: <tr id="MeasurementTr" runat="server" visible="false"> <td> &nbsp;</td> <td class="table_label"> Measurement</td> <td> &nbsp;</td> <td> <asp:DropDownList ID="DlMeasurement" runat="server"> </asp:DropDownList> </td> <td> &nbsp;</td> </tr> and my javascript, alert(document.getElementById("ctl00_ContentPlaceHolder1_MeasurementTr").style.visibility); if (document.getElementById("ctl00_ContentPlaceHolder1_MeasurementTr").style.visibility=="visible"){ if (document.getElementById("ctl00_ContentPlaceHolder1_DlMeasurement").selectedIndex == 0) { document.getElementById("ctl00_ContentPlaceHolder1_ErrorMsg").innerHTML = "Please Select Your Measurement"; document.getElementById("ctl00_ContentPlaceHolder1_DlMeasurement").focus(); return false; } } But my alert shows nothing... It didnt show null or undefined...

    Read the article

  • Setting initial state of a JSF component to invalid

    - by user359391
    Hi there I have a small JSF application where the user is required to enter some data about themselves. For each component on the page that has required="true" I want to show an icon depending if there is data in the field or not. My problem is that when the page is initially shown all fields are valid, even if they do not have any data in them. So my question is how I can set a component to be invalid based on if there is data in the field or not? After a submit of the page (or after the component loses focus) the icon is shown properly, it is only on the initial page load I have a problem. (i.e there is no post data) Here is my xhtml for a component that needs to be validated: <s:decorate id="employeeIdDecoration" template="/general/util/errorStyle.xhtml"> <ui:define name="label">#{messages['userdetails.employeeId']}</ui:define> <h:inputText value="#{authenticator.user.employeeId}" required="true"> <a4j:support event="onblur" reRender="employeeIdDecoration" bypassUpdates="true"/> </h:inputText> the template: <s:label styleClass="#{invalid?'error':''}"> <ui:insert name="label"/> <s:span styleClass="required" rendered="#{required}">*</s:span> </s:label> <span class="#{invalid?'error':''}"> <s:validateAll> <ui:insert/> </s:validateAll> <h:graphicImage value="/resources/redx.png" rendered="#{invalid}" height="16" width="16" style="vertical-align:middle;"/> <h:graphicImage value="/resources/Checkmark.png" rendered="#{!invalid}" height="16" width="16" style="vertical-align:middle;"/> </span> Any help will be appreciated.

    Read the article

  • is there a Java GUI for dummies ?

    - by MHero
    Hello, first I want to apologize about my english, it may be not clear enough. Well, I'm new to Java programming, and I search over this web about use of Swing, AWT, 2D, etc. but I didn't get the answer I was looking for. I want to know about a book or method to learn Java GUI programming (not even sure this is a propper term). Previous answers guide me to Filthy Rich Clients by Romain Guy and also to The Swing Tutorial in Sun Web Page. and No offense, but...the first one seems too complex and the second one a bit disorganize. so I ask about a more "for dummies" method. Thanks EDIT: Thanks everyboy, you're very kind and serious. I want to clear some things that I didn't state for being my first question. I dont' want to use autogenerated code(Don't want to say why only focus on my question for consistency) Also I've read Deitel & Deitel and it's a good beginners book but it seems to me that doesn't cover layout(and other details) Finally, I tried to read netbeans generated code but it's a mess find method by method and function by function the way that the IDE does it I hope this edition helps to solve my question

    Read the article

  • Recaptcha with Ajax error

    - by Brandon
    I'm having trouble validating a recaptcha input. Heres my code: // Validate Recaptcha Input var challenge = $("#recaptcha_challenge_field").val(); var response = $("#recaptcha_response_field").val(); var dataString = 'recaptcha_challenge_field=' + challenge + '&recaptcha_response_field=' + response; var html = $.ajax({ type: "POST", url: "PHP/recaptchaverify.php", data: dataString, async: true }).responseText; console.log(html); if(html == 'accept') { alert("CORRECT"); } else { alert("The reCAPTCHA wasn't entered correctly. Go back and try it again."); $("#recaptcha_response_field").focus(); Recaptcha.reload(); return false; } Now I passed my variables to recpatchaverify.php require_once('../scripts/recaptcha-php/recaptchalib.php'); $privatekey = "MYKEY"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly echo "error"; } else { // Your code here to handle a successful verification echo "accept"; } Now my problem is the html variable is displaying "accept" whenever I enter the Recaptcha correctly, but it won't work in the IF statement?

    Read the article

  • why it makes ie6 or ie8 compatible mode crash

    - by hylin
    Anybody can tell me why those code can make ie6 or ie8 compatible mode crash? PS:I know,there is so many ways to avoid this satuation, but I just want to know why. To avoid: Change class="wrapper"--class="wrapper2" or other != "wrapper" $('wrapper').style.overflow='visible'; -- setTimeout(function(){$('wrapper').style.overflow='visible';},10); Or remove any style , js operation... <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <style>.wrapper{width:975px;margin:60px auto 0}</style> </head> <body id="wrapper" style="overflow:hidden;"> <div id="overlay" style="position:absolute;"></div> <div class="wrapper"> <input type="text" id="input1"/> <a id="btn" href="javascript:;">test</a> </div> <script type="text/javascript"> $('btn').onclick = function(){ $('overlay').style.display='none'; $('wrapper').style.overflow='visible'; $("input1").focus(); } function $(s){ return document.getElementById(s); } </script> </body> </html>

    Read the article

  • Problem with mathamatical calculation in JQUERY

    - by Param-Ganak
    Hello friends! I have two text boxes. I enter number in one textbox. I write following JQUERY for that textbox which get executed when the focus out from first text box. The JQUERY code takes the entered value from first text box and multiply it by a decimal number 34.95 and display the answer in second text box. The code is doing the calculation little bit ok because when I enter the value 1000 in first text box it gives answer 34950 in second textbox and when I enter the value 100 in first text box it gives answer 3495.0000000000005 in second text box. **Please any one tell me what is the problem. is problem is in my JQUERY code. I also want to show the answer always in decimal point. Answer should always dislply only two digits after decimal point. so How to achieve this too.** This is my JQUERY code. $("#id_pvalue").focusout(function() { q=$("#id_pvalue").val(); var ans=q*34.95; $("#id_tvalue").val(ans); }); Please guide me friends! Thank You!

    Read the article

  • How can I programmatically determine if my workstation is locked?

    - by AgentConundrum
    I'm writing up some productivity/metrics tools for myself to help monitor my focus throughout the day. Recently, I've noticed that I tend to get off track more than usual and feel the need to get up and go for walks/drinks/etc and I'm concerned that I'm "wasting" too much time. Since I always lock my computer when I go anywhere, and I unlock it as soon as I return (even if I'm just reading at my desk, etc), I was wondering how I can determine, in code, how long the machine is locked. I'm writing this in C# if that helps, but I'm open to other ideas. I like the windows service idea (and have accepted it) for simplicity and cleanliness, but unfortunately I don't think it will work for me in this particular case. I wanted to run this on my workstation at work rather than home (or in addition to home, I suppose), but it's locked down pretty hard courtesy of the DoD. That's part of the reason I'm rolling my own, actually. I'll write it up anyway and see if it works. Thanks everyone!

    Read the article

  • jquery .blur for entire block of HTML

    - by Stacey
    I have an HTML item for a 'drop down menu', structured like this... <li class="ui-dropdown-list" > <a href="#">Right Drop Down Menu</a> <ul> <li><a href="#">Item</a></li> <li><a href="#">Item</a></li> <li><a href="#">Item</a></li> </ul> </li> Using jQuery to make this a dropdown list, with the following code. jQuery.fn.dropdown = function () { var defaults = { button: null, menu: null, visible: false }; var options = $.extend(defaults, options); return this.each(function () { options.button = $(this); options.menu = $(this).find("ul"); // when the parent is clicked, determine whether dropdown needs to occur options.button.click(function () { options.visible ? lift(options.menu) : drop(options.menu); options.visible = !options.visible; }); // drop the menu down so that it can be seen. function drop(e) { options.button.addClass("open"); options.menu.show(); } // lift the menu up, hiding it from view. function lift(e) { options.menu.hide(); options.button.removeClass('open'); } }); }; I am trying to wire it up so that if the user clicks anywhere outside of the menu, it will collapse it. This is proving much more difficult than I anticipated; even trying to use page level events. Any suggestions? The menu itself never really 'receives' focus, so using .blur doesn't seem to be suiting the purpose.

    Read the article

  • Continuously updating chat messages

    - by Daniel
    I'm creating a very simple chat application. It has an ASP.NET web page as front-end and a WCF service as back-end for storing the messages to a database. Everything works great except one thing; when Browser A enters a chat message I want Browser B to see the message as soon as possible (yeah, I know, that's the purpose of a chat). What I've done so far is to setup a trigger within the UpdatePanel, like this: <Triggers> <asp:AsyncPostBackTrigger ControlID="chatTimer" EventName="Tick" /> </Triggers> which uses a timer: <asp:Timer ID="chatTimer" runat="server" OnTick="chatTimer_Tick" Interval="1000" /> Is this the best approach or is there a better, yet simple, way to accomplish updating of messages. One drawback with this solution is that the textbox used to enter chat messages loses focus every time the Tick event runs. Any piece of feedback or advice regarding updating of messages is appreciated. Thank you!

    Read the article

  • Search Box/Transition won't work in Firefox

    - by user2522488
    I disabled the search box on IE, because IE kept centering it over the navigation. It works in Chrome, I'm not sure about opera (and I'm not sure if I care) but it won't work in Firefox. The ease-out timing works in Firefox, but nothing else really works. I've tried other things to work around the issue, but every time I try something different, the search box's positioning gets thrown off. If you look at it in Firefox, it looks fine-- until you click on it to search. http://kissoff.weebly.com/ You can see what the search box is supposed to do if you look at it and click on it in Chrome. I'm sure the positioning is off, I'm not sure (I'm new to css). Any help is appreciated. #search {} #search input[type="text"] { background: url(search-white.png) no-repeat 10px 6px #fcfcfc; border: 1px solid #d1d1d1; position: fixed; margin-left: 350px; margin-right: 0px; margin-top: 0px; color: #bebebe; width: 150px; padding: 6px 15px 6px 35px; -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset; -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset; -webkit-transition: all 0.7s ease 0s; -moz-transition: all 0.7s ease 0s; -o-transition: all 0.7s ease 0s; transition: all 0.7s ease 0s; float: right; } #search input[type="text"]:focus { width: 200px; }

    Read the article

  • Form wont stay on top. How do I keep my excel form from hiding behind other windows after I browse

    - by ScottK
    I have a vb.net program that opens up an excel workbook and runs a macro ("Report") in that workbook when a button is clicked. //Workbook with macro and form xlWorkbook = xlApp.Workbooks.Open("W:Data\Excel Program.xls") //Macro: xlApp.Run("Report") //Macro opens form from workbook. I browse for my two .csv files //and then click a button to run code that creates my reports. //form closes, show the excel report after its created xlApp.Visible = True After I browse my first file and select it so that its location is displayed in my text box, the excel form then hides behind any open windows. I want this form to stay on top. It is after this code executes that the form will hide behind all other open windows: Private Sub btnBrowseFile1_Click() Dim fileName1 As String fileName1 = Application.GetOpenFilename("CSV file (*.csv), *.csv") If fileName1 <> "False" Then Me.txtFileName1.text = fileName1 End If End Sub EDIT: I still have no luck with this problem. When the excel macro is opened from a vb program I have this hiding issue...but only after browsing for a file. Why does the focus leave the form and go to Windows after browsing a file? Any one have any suggestions?

    Read the article

  • After a few same hql query the application freezes

    - by Oktay
    I am calling below function with the same batchNumber and it is working without problem 15 times and takes the records fromm database without problem but at 16. time the application freezes when the query.list() row is called. It just loses debug focus and not give any exception. This problem probably is not about the hql because I've seen this problem before and I used criteria instead of hql and I got pass this problem. But for this when I use "group by" in criteria(setrojection....) it doesn't return the result as hibernate model(object) just returns a list. But I need the results as model. Note: about 15 times it is just for test. This is a web aplication and user may click the button many times that calls this funtion to see the taken records from database. public List<SiteAddressModel> getSitesByBatch(String batchNumber) { try{ List<SiteAddressModel> siteList; MigrationPlanDao migrationPlanDao = ServiceFactory.getO2SiteService().getMigrationPlanDao(); Query query = this.getSession().createQuery("from " + persistentClass.getName() + " where " + "siteType =:" + "type and siteName in " + "(select distinct exchange from " + migrationPlanDao.getPersistentClass().getName() + " where migrationBatchNumber =:" + "batchNumber" + ")" ); query.setString("batchNumber", batchNumber); query.setString("type", "LLU/ASN"); System.out.println("before query"); siteList = query.list(); System.out.println("after query"); return siteList; }catch (Exception e) { e.printStackTrace(); } Hibernate version 3.2.0.ga

    Read the article

  • onKeypress Enter Key event on textfield not working in Chrome

    - by rlcrews
    I have a question along the same vein as the one asked here regarding how the enter key is handled in chrome. The effect I am trying to accomplish is to allow the enter key to call a click event of one a button while focus in within the current field. To accomplish this I am using the following code: javascript: <script type="text/javascript"> //attempting to capture keypress for chrome here but this is not working $("#txtContainer").keypress(function (e) { if (e.keyCode == '13') { e.preventDefault(); doClick(buttonname, e); return false; } }); function doClick(buttonName, e) { var key; if (window.event) key = window.event.keyCode; //IE else key = e.which; //firefox if (key == 13) { var btn = document.getElementById(buttonName); if (btn != null) { btn.click(); event.keyCode = 0 } } } </script> within the aspx <form id="form1" runat="server"> <div> <asp:LinkButton ID="newBtn" runat="server" OnClick="btnLogin_Click" Text="ASP Link" /> <asp:TextBox ID="txtContainer" runat="server" Width="100" /> <asp:Label ID="time_lbl" runat="server" /> </div> </form> and within the code behind aspx.cs protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { txtContainer.Attributes.Add("onKeyPress", "doClick('" + newBtn.ClientID + "',event)"); } } public void btnLogin_Click(object sender, EventArgs e) { time_lbl.Text = txtContainer.Text; } The above code works fine in FF and IE however chrome continues to submit the entire form vs. capturing the keypress on the enterkey. Thank you for any suggestions.

    Read the article

  • Using unions to simplify casts

    - by Steven Lu
    I realize that what I am trying to do isn't safe. But I am just doing some testing and image processing so my focus here is on speed. Right now this code gives me the corresponding bytes for a 32-bit pixel value type. struct Pixel { unsigned char b,g,r,a; }; I wanted to check if I have a pixel that is under a certain value (e.g. r, g, b <= 0x10). I figured I wanted to just conditional-test the bit-and of the bits of the pixel with 0x00E0E0E0 (I could have wrong endianness here) to get the dark pixels. Rather than using this ugly mess (*((uint32_t*)&pixel)) to get the 32-bit unsigned int value, i figured there should be a way for me to set it up so I can just use pixel.i, while keeping the ability to reference the green byte using pixel.g. Can I do this? This won't work: struct Pixel { unsigned char b,g,r,a; }; union Pixel_u { Pixel p; uint32_t bits; }; I would need to edit my existing code to say pixel.p.g to get the green color byte. Same happens if I do this: union Pixel { unsigned char c[4]; uint32_t bits; }; This would work too but I still need to change everything to index into c, which is a bit ugly but I can make it work with a macro if i really needed to.

    Read the article

  • Why can’t I create a database in an empty ASP MVC 2 project using Project->Add->New Item->SQL Server

    - by Dr Dork
    I'm diving head first into ASP MVC and am playing around with creating and manipulating a database. I did a search and found this tutorial for creating a database, however when I follow it, I get this error right at the start when trying to add a new database to my fresh, empty ASP MVC 2 project... A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) The only requirement the tutorial mentioned was SQL Server Express, but when I went to download it, it said it was already installed. I'm assuming it was part of the VS 2010 RC I installed and am running. So I don't know what else I need if I am missing something. This is all new to me, so I'm sure I'm missing something obvious here and after I'm done posting this question, I plan to do some more research into the topic of databases and how they work with ASP MVC. In the meantime, I was you could help me answer a couple high level questions... What am I missing/forgetting to do that is causing this error? Any suggestions for good resources/tutorials that focus on using databases with ASP MVC? I've done a lot of database programming in the past, so I'm familiar with the concepts of relational databases and the SQL language. I wish I could find a good resource for learning how to work with them in an ASP dev environment, as well as a good breakdown of all the related technologies used for working with them (i.e. LINQ to SQL). Thanks so much in advance for all your help! I'm going to start researching these questions right now.

    Read the article

  • GDI+ not clearing my window on repaint for vista

    - by Michael
    on WM_PAINT i do the following: //RectF mNameRect; //WCHAR* mName; //HWND mWin; // this is the window handle { PAINTSTRUCT ps; HDC hdc = BeginPaint(mWin, &ps); Graphics g(hdc); g.Clear(Color::White); StringFormat stringForm; stringForm.SetLineAlignment(StringAlignmentCenter); stringForm.SetAlignment(StringAlignmentCenter); // set the rectangle to the size of the whole window mNameRect.Width = static_cast<float>(size.cx); mNameRect.Height = static_cast<float>(size.cy); g.DrawString(mName, -1, &mNameFont, mNameRect, &stringForm, &mNameBrush); EndPaint(mWin, &ps); } In XP this works fine, the mName is displayed in the middle of the window. However on Vista the text doesn't move, it stays in its location no matter how I resize the window. the g.Clear(Color::White) doesn't seem to do any difference. The text doesn't even change position when the window is hidden behind another window and on focus needs to be repainted again. How do I make mName change position in Vista?

    Read the article

  • Select All in Javascript (Firefox extension) not working right

    - by leezer3
    I'm having some problems with a select all/ none function. (I didn't write it, I'm trying to fix it!) It currently looks like this: rsfindmod.SelAll = function(){ document.getElementById("ListBox").selectAll(); document.getElementById("ListBox").focus(); } It's being used on a dynamically generated set of links, so there's no set number of items in this listbox. This seems to work most of the time, but randomly it only selects those which are visible at the time. Scrolling the list or hitting the button again seems to normally make it work as expected. My first (Obvious?) thought was to replace the function entirely with the one from this link for testing: http://viralpatel.net/blogs/2009/06/listbox-select-all-move-left-right-up-down-javascript.html Trouble is that I can't get this one to work whatsoever! This gives me the error that listbox.options is not defined Any thoughts please? I'm by no means certain whether it's the original function at fault, or something in the generation of this listbox.

    Read the article

  • Trouble recording unique regex output to array in perl

    - by Structure
    The goal of the following code sample is to read the contents of $target and assign all unique regex search results to an array. I have confirmed my regex statement works so I am simplifying that so as not to focus on it. When I execute the script I get a list of all the regex results, however, the results are not unique which leads me to believe that my manipulation of the array or my if (grep{$_ eq $1} @array) { check is causing a problem(s). #!/usr/bin/env perl $target = "string to search"; $inc = 0; $once = 1; while ($target =~ m/(regex)/g) { #While a regex result is returned if ($once) { #If $once is not equal to zero @array[$inc] = $1; #Set the first regex result equal to @array[0] $once = 0; #Set $once equal to zero so this is not executed more than once } else { if (grep{$_ eq $1 } @array ) { #From the second regex result, check to see if the result is already in the array #If so, do nothing } else { @array[$inc] = $1; #If it is not, then assign the regex search result to the next unused position in the array in any position. $inc++; #Increment to next unused array position. } } } print @array; exit 0;

    Read the article

  • How can I define an irregular area of the screen and find the closest point to the mouse in that area?

    - by JonathonG
    I'm looking for a method to define an area of the screen that the mouse cannot leave. I have been directed by rob mayoff, the answerer of this question, that I can use a Quartz Event Tap to detect mouse events. This puts me part of the way to the solution to THIS question. I need to define an irregular area of the screen, not just a rectangle, that the mouse cannot leave. I have been researching this and the only idea I can come up with is using a bitmap to define the irregular area, as it will be very oddly shaped. However, I am open to solutions other than using a bitmap. Since this must be done on a Mac, I've determined that I will have to use objective C / Cocoa . I need to know how to define the area and, equally importantly, how to find the closest point in the area to the mouse (so that I can move the mouse to it if the mouse tries to move outside of the area). This is similar to what the restricted area will look like: [edit:] Okay, I've come up with part of the answer to this. If I can do a basic (light-weight) point collision detection on the image mask, I can use a simple algorithm to detect the closest point to the mouse on the black area of the image. I could do this by calculating distance between a pre-defined point (P) inside the black area of the image and the target mouse position (T), taking the midpoint (M), then checking if the midpoint is inside or outside of the shape (black or white, respectively). If M is inside the shape, then move the P to M, otherwise move T to the M, continuously recalculate this until the distance between T and P is 1 pixel or less, then move the mouse to the final calculated position. All of that being said, I still need some way to test the position of the mouse against that same position on the bitmap (assume the bitmap is the same resolution as the monitor), and check if that point is black or white. All of this needs to be done in the background, without this application actually having focus, or the bitmap being visible... is this possible?

    Read the article

  • Unable to `submit()` an html form after intercepting the submit with javascript.

    - by Ross Rogers
    I'm trying to intercept the submission of a form in order to change the value of my keywords label. I have the following code: <HTML> <FORM name="searchForm" method="get" action="tmp.html" > <input type="label" name="keywords" /> <input type="button" name="submit" value="submit" onclick="formIntercept();"/> </FORM> <SCRIPT language="JavaScript"> document.searchForm.keywords.focus(); function formIntercept( ) { var f = document.forms['searchForm']; f.keywords.value = 'boo'; f.submit(); }; </SCRIPT> </HTML> When I run this in chrome and click the submit button the keywords label changes to boo, but the javascript console says: Uncaught TypeError: Property 'submit' of object <#an HtmlFormElement> is not a function. How can I submit the form with the manipulated keywords?

    Read the article

  • Why does this CSS button mess with <a> tags?

    - by Ian McCullough
    Here is my CSS button { border: 0 none; cursor: pointer; padding: 0 15px 0 0; text-align: center; height: 30px; line-height: 30px; width: auto; } button a { color:white; text-decoration:none; } button.rounded { background: transparent url(/images/button/btn_right.png) no-repeat scroll right top; clear: left; font-size: 0.8em; } button span { display: block; padding: 0 0 0 15px; position: relative; white-space: nowrap; height: 30px; line-height: 30px; } button.rounded span { background: transparent url(/images/button/btn_left.png) no-repeat scroll left top; color: #FFFFFF; } button.rounded:hover { background-position: 100% -30px; } button.rounded:hover span { background-position: 0% -30px; } button::-moz-focus-inner { border: none; } Here is the code for my "button" with a link in it. <button class="rounded"><span><a href="profile.php">Profile</a></span></button> The issue is it does not link to the href when i click on it. Anyone know why?

    Read the article

< Previous Page | 143 144 145 146 147 148 149 150 151 152 153 154  | Next Page >