have this script to add a textbox at runtime. I wanted to limit the number of textboxes the user could throw out so i added a counter and limit to the script.
Here's the code
var counter = 1;
var limit = 3;
function addEvent() {
if (counter == limit) {
I am working on a site in which I must make a text box that cannot allow numbers to be entered. My only problem is that I cannot insert an onKeyPress or onKeyDown event into the input tag itself, I must do this elsewhere in my code.
Below is the script and form fields I am working with. What I want to do is sum the two textbox fields and have the result show in the total textbox. The code works fine and the total textbox is updated with the value of form1.basic. The problem occurs when I add the "+ parseInt(document.form2.supporter.value)" code in the script section.
One person to date has received a runtime error message saying "parent.frameleft.location is not an object" with the following code. The code is used to select 2 frames at the same time...
I am using this browser that came with an sbcglobal account and when I click on the built in "shopping" button (and others), sometimes i get a jscript runtime error. It happens often but not always. It is very annoying. When I launch the debugger I don't know what i am looking at.
My question is. Is there anything I can do to stop this from popping up? Or is this caused by the source from the site?
Is Javascript build in to the browser or is there someway i could update it. Would that help?
Would using a different browser help? I think this is sbcglobals own browser but it might be based on IE.
I'm new to javascript, but i'm currently having to work on a basic online shop with a shopping cart on the same page as the items on sale. As i said, its pretty basic and it works ok in firefox, however IE kicks up a fuss over lines 14 and 36 (highlighted red) and i can't work out why.code...
i am checking the checkbox is checked r not by using following code.... if the condition is true i have to checked another box in runtime using docuemnt.form... or document.getElementById like...document.form.chkbox2=checked like that...
does anyone know how I can build a regular expression e.g. for the string.search() function on runtime, depending on the content of variables? Should be something like this:
var strkey = "something"; var str = "Somethin like this";
Can anyone suggest how to create an arbitrary object at runtime WITHOUT using the deprecated eval() function. The eval() method works ok (see below), but is not ideal.
function Client() { } Client.prototype.fullname = "John Smith"; var s = "Client"; eval("var o = new " + s + "();"); alert(o.fullname);
Note: I want the type name of the object to be represented as a string (in this case "Client" -- this is a non-negotiable requirement).
I also tried the following (which appears to fail):
function Client() { } Client.prototype.fullname = "John Smith"; var s = "Client"; var o = new Object(); o.construct = s; alert(o.fullname);
eval() is handy but not future-proof, so any suggestions would be welcome.
Is it possible that first I make my window resizable,than if window is less than a fixed size I can make my window not resizable?Better to say can I change resizable feature during runtime?If possible,than how?
I need to set the position of an element to fixed using JavaScript at runtime. Sadly, IE6 does not know this value, so I want to use the following workaround:
Instead of setting the position to fixed, I set it to absolute for IE6, and the top value needs to be the following expression:
I'm fairly new to Javascript. I am modding a script for an Event Calendar (view), and am running into a problem in IE.
What I want to do is, when the user clicks on a date that has an event attached to it, the event information is displayed in a div below the calendar. I've used a switch() statement, and have gotten it to work the way I want in Firefox, but IE gives me an error. code...
This is where the event description then shows up.
I'm building a shopping website that within the products' page, there's an HTML select that allows the user to choose what product type he wants to view. beneath the select, there's a heading followed by a div or a table created at runtime showing the product name, image and a description.
My problem is in dynamically write the title. The designer provided me the prototype with a static heading in a span,once i try to automate it, the heading is created on a blank page not within the same page.
Here's my code so far:
I think the problem is in document.write and it's the way it works, but i need something to write the heading in the same place of the code.
I have a loop that creates multiple divs, and assigns each one it's own id and positioning on the page. Everything is working fine here.
However, I need to have a different onmouseover for each div (I'm going to be using an ajax call inside each onmouseover that pulls a different url depending on the div that you have pointed at)
Here is the snippet of code that I used to add the onmouseover attribute to each div. This section of code is inside a larger loop, so the "div" variable is a unique div on each iteration of the loop:
div.onmouseover = function() { var x1 = (str[0]+3)/9; var y1 = (str[1]+3)/9;
[Code].....
The str array is a collection of x and y coordinates that the script at star_name.php uses to determine what information needs to be displayed inside the div "label_texter" in the ajax call. If you are not familiar with the mootools framework, you can ignore most of the code inside the function.
The real problem is that for some reason, all the div's created end up with the exact same thing within the url variable. Even though the str[0] and str[1] variables are changed on each iteration of the loop.
In fact, it seems as though they all end up with the last str array values in the loop.