This is a personal problem (he he) - not for work or school. I have tried to avoid adding Javascript to the things I need to learn but now I find myself needing to use it. I have several textareas in a form. I found (on this forum) a short piece of code (function) that will clear a textarea. It works just fine as long as I hard code the textarea name. I would like to use this one function and pass to it the name or Id of the text area I want to clear.
I would like to display a series of smaller foreground images on top of a larger background image and possibly even control the position of the smaller images dynamically. Is this possible? If so what is the syntax for placing the small images on top of the large one.
I am attempting to pass two user inputs into one variable (text, not array) to pass through my credit card company.
What I have done it two "onchange" scripts so that when the customer enters their information the script runs it does a search and replace on "name" for there name and "number" for their number. However!! If they change their name (or number) a second time the search and replace will fail as it will no longer find "name". Therefore I though some sort of RegX facilitated where I prefix their name with a hypen i.e. '-'.
Is it possible to use regX in this way in Javascript? Can anyone provide advise or a link? Alternatively, am I making this a lot harder than it needs to be!? i.e. could I do an onSubmit instead to change it? I have tried this, however it didn't seem to work.
I've written several scripts that have "while" blocks which increment a date by one day if the date does not match one of a group of dates. However, sometimes it apparently steps out out the while loop even though my condition isn't met. Will work for a few loops then steps out often.
Are there javascript "date" issues? I have also noticed different results between Firefox and Internet Explorer.
jQuery('div#primary').attr('width', '300'); I am manipulating html file. I am doing the above. But It is not updating the html file with the new width.
I am currently creeating a navigation, am am a bit stuck with the navigation.[code]So there should be a new <ul> after every third list element in the sub-menu.[code]
we have a piece of code which does some XML manipulation and it broke in IE (at least 7) between jQuery 1.5 and 1.6.At this link is the chunk of code running on 1.5.2:[URL]and at this link is the same exact code on 1.6.1 and erroring in IE: [URL]On the second link, IE is reporting an error down in jQuery for invalid number of arguments to a method. The second alert never shows.
I want a script to receive a time in the 24 hour time format HH:mm (e.g. 18:30) and remove 15 minutes from it.The problem is that if the time inputted was 00:00, then how do I get to 23:45?
I'm sure it's easy if you're in the know.I can do this with PHP, but not with JS.I just need the function / basic line of code that does this. I can work out how to call it etc. myself.
I'm trying to write some javascript code that will swap two rows in a table, in an attempt to provide users with an easy and visual way to manually change the order of the listed items in a table.
The sample code works as it should in IE, and switches the two rows nicely.
In Mozilla however it fails the first time, but for some odd reason it works fine afterwards.
Mozilla doesn't seem to be removing the duplicated node the first time, which makes it appear as if an extra node is inserted into the table (which is actualy the case), but on subsequent attempts, it seems to be removing the duplicated node perfectly... Code:
This construction isn't working. The variable strName gets the name of the object (i.e. afkorting) but the alert doesn't work. Has somebody an idea what I'am doing wrong?
I built an IE-only function that modifies the DOM to create a custom container with rounded corners and some shading at the top. It only gets called when the browser is IE and its version is < 9. It takes the following block:
And turns it into this:
The UI looks identical to FF, which uses the CSS3 attributes to create the rounded box. HOWEVER, in IE8, I can no longer access the embedded <input> element (which does not change). I'm trying to get the value of the <input> tag with the ID of "username" by doing this:
When I disable my DOM manipulation code so that in IE, it remains an ugly, square box, I can get the value of the <input> element with no problem. Once I manipulate the DOM, IE always returns the empty string while FF and Opera work perfectly.
I need to do multi DOM manipulation into a page without reload it (something like: when i click on a thum in another part load a photo with a specific text, if i click on this text load another photo).
I use a js like:
First page loading everything goes good.... but when i fall into MY_CODE1, i can't execute MY_CODE2 anymore.....
I need this iframe for a facebook tab, since they changed the width to 520px. The original page in the iframe is 700px wide, and I've changed a few CSS properties using the frameReady plugin. It's works just fine, but trouble starts, when i'm navigating the target site, the CSS properties I've changed goes back to the original settings.
What I have going on is an input box where they type in an account name. And the autocompleter works perfectly if they choose an item in the list.However, I want them to have the option of entering an account that is not in the list. And when they do this, the onblur event triggers the opening of the New Account box where they can fill out the new account information and submit the form back.Once again when a selection is made it works just fine, it's when the user creates a new account that it doesn't trigger the "getAccountInfo" function.
In the below, I would expect this to return the number of milliseconds since the epoch. Instead, it's generating a massive negative number. I presume I've gone wrong with the set[Blah] methods.
javascript Code:
var date_text = '2009-03-06 12:00:00'; var d_tried = new Date(); d_tried.setYear(parseInt(date_text.substr(0,3))); d_tried.setMonth(parseInt(date_text.substr(5,6))); d_tried.setDate(parseInt(date_text.substr(8,9)));
I want to be able to create 2 Divs, one for my navigation button and a second for an image to be placed in. I want to be able to have the 2nd div move position to underneath Div 1 when I hover over the navigation (div 1). I've attached a link to a diagram of what I mean [URL].
I manipulate XML with jQuery with no problem in all browseres but not in Internet Explorer. I serched bug-fix and I found "metadata.js" but still not working in my Internet Explorer 7.It's just too nice to manipulate XML with jQuery...As a matter of fact... a simple example of extracting some data:Script page:
<!DOCTYPE html PUBLIC "-//W3C// DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head>
[code]....
Code works perfectly in all browsers except IE (Internet Explorer - "failing forever". Good job MS )
I need this iframe for a facebook tab, since they changed the width to 520px. The original page in the iframe is 700px wide, and I've changed a few CSS properties using the frameReady plugin. It's works just fine, but trouble starts, when i'm navigating the target site, the CSS properties I've changed goes back to the original props.
[Code]...
Try clicking any of the 'view on map' links, then you'll see where I'm getting at.
How could I work around this? Can I make it apply the script every time something new loads into the iframe?
I got my code for adding my table ( HTML manipulation )But the problem is, that if u click an empty row, it need to change letter from S to Z ( and empty ( space ) So, i actually don't know how i can use those multiple's, so i started scripting from just an space to ... it didn't work.. but i was sure my script works, so i used it on other page .. and it worked ... here is my code
I am trying to make a canvas element display an image with some text on using canvas.drawImage and canvas.fillText. Only problem is my code is generating a very odd and hard to debug error.
How would i change back to the default length of textarea?
I have this comment area that after clicking submit i will append the new comment in the list of comments through ajax... i got one problem though, everything is working perfectly well except for the textarea that won't change back to it's default size...
EXAMPLE:
The problem is that the textareawon't change back to it's default size // let's say that the default size is rows=3