Javascript textbox highlight question
I've got a textbox, and I want to select a substring programatically. Is there an easy way to do this? ...
I've got a textbox, and I want to select a substring programatically. Is there an easy way to do this? ...
I have a button in my abc.html page <input type="button" onclick="javafun();"> on the click it goes to javascript, which further send info to my abc.php ...and the javascript function looks like: function login() { xmlhttp=GetXmlHttpObject(); //alert("pass"); if(xmlhttp==null) { alert("Your browser does not s...
I'm using Dojo trying to build an application with dojo's dnd. I've looked around for an answer to this problem but I'm just not sure how to accomplish this. I have a Source object in which there are a bunch of products formatted with html/css in a certain way. When I drag these objects to my Target object, the dropped item still looks t...
Us Mootoolers and Prototypers (what few are on this site) usually carry around a handy toolbox of functions we have created (or borrowed) that we implement on native javascript objects to make our lives a little easier. I wanted get a list together of very helpful prototyped functions, but only ones that are implemented on native object...
I'd like to augment the Function object to do more operations while constructing a new object. Is it possible? ...
Currently the location of my Html is http://severname.com/qotw.html. Onclick of a button i call the login(); the login() javascript function, looks like this: function login() { passwrd = document.f_signin.password.value; username = document.f_signin.username.value; if (username==""){ document.getElementById("response").inner...
What is the advantage to putting you javascript for your rails app into a .js.erb file instead of just throwing it in your application.js file? I have a create button for businesses so should I put the code into a create.js.erb file or put it into my application.js using: $("#business_submit").click(function() {} All that aside is tha...
Try as I might, I can't get a RegEx to exclude space or single quotes. The string "abc" is allowed Not allowed: "a'bc", "'", "'abc", "'''", "abc''" etc Spaces could replace the ' too in the above example Trailing and leading spaces are assumed to be removed already Empty strings are checked elsewhere Target language is javascript I'd...
Sample code: function TestClass() { this.init = function() { this.updateHeader(); // <-- error line }; this.updateHeader = function() { console.log("Works"); }; }; var test = new TestClass(); $(document).ready(test.init); When I run that in Firefox 3.5, Firebug gives me an error, saying that this.updateHeader is not a valid fun...
I have a number in Javascript, that I know is less than 10000. I want to display it as a four-digit number, with leading zeroes. Is there anything more elegant than the following? if(num<10) num="000"+num; else if(num<100) num="00"+num; else if(num<1000) num="0"+num; I want something that is built into Javascript, but I can't seem t...
I have a class: function RustEditor() { this.init = function() { var saveButton = this.container.find("button.saveButton"); saveButton.click(function(){this.save();}); }; ... When I click the button, it complains that this.save is not a function. This is because "this" does not refer to the instance of RustEditor here, but to the...
Strange problem going on here. I'm developing a JSR168 portlet that is using Spring and the Spring form taglib. I have a search form on a page to go through a catalog of reports based on the criteria the user selects, and for the most part it works fine. However, there is one sequence of events that is triggering an error. I have a Jav...
I have an array in Javascript: var array = new array(); array[0] = "apples"; array[1] = "oranges"; array[2] = "pears"; In PHP, with a given array, I can use the following to loop through an array, and break up the keys and values: foreach ($array as $key => $value) { echo("Key is $key and Value is $value"); } How can I do this ...
I have the following script; Timer=0; function countdown(auctionid) { var auctions; var divs; Timer=Timer+1; if((Timer%10=="0")||(Timer=="1")){ $.get("current.php", { id:auctionid}, function(data){ auctions=data.split("||"); for(n=0;n<=auctions.length;n++) { if(auctions[n] != undefined) { divis=auctions[n].split("##"); $('#futu'+divi...
Hello all :) I have a javascript that calls a function each 1 minute. That function sends a bot on the web looking for information to update on my database (quotes, to be exact). So basically, sometime it's pretty fast and other times the servers dont answer fast... Let's say I have 100 seeks like this to make each 1 minute. They coul...
I'm working on an app that allows tagging directly on photos via clicking (like Facebook, flickr, et al). However, I can't seem to register the right coordinates for a click on a photo. The problem is the x coordinates seem to be absolute x distance of a click within the browser window(rather than within the photo), while the y coordi...
Let's say I've got a method that takes some arguments and stores them as instance variables. If one of them is null, some code later on is going to crash. Would you modify the method to throw an exception if null arguments are provided and add unit tests to check that or not? If I do, it's slightly more complicated since javascript has m...
Hi, I'm having some trouble with IE6 and jQuery UI. I have a popup dialog (modal, if it matters), that displays a "yes/no" dialog to the user with some information. In order to facilitate this, I build the dialog with autoOpen = false, and then I call $('#popup').show() later on as needed, in response to various different events. Now, in...
I have a asp:GridView which contains a asp:TextBox within a TemplateField. I would like to obtain it's ID for use in javascript. Something like this: <asp:TemplateField> <ItemTemplate> <asp:TextBox ID="textDateSent" runat="server" /> <input type="button" value='Today' onclick="setToday('<%# textDateSent....
i found this script: <script language="Javascript" TYPE="text/javascript"> var container = document.getElementById('dl'); var seconds = 10; var timer; function countdown() { seconds--; if(seconds > 0) { container.innerHTML = 'Please wait <b>'+seconds+'</b> seconds..'; } else { container.innerHTML = '<a href="do...