Please visit the following page if you want to see the page I am working with. The flower images at the bottom, when clicked, will display the src of that image when clicked in the textbox. However, I want to apply the same function to the manipulated images too, in order to get their data URL's. Currently, the images at the bottom have the following:
Code:
<img src="images/nem.png" onclick="clicked(this)" />
How would I go about adding the onclick to the following javascript generated images?
Code:
var dragon = new Image();
dragon.src = "images/flower2.png";
var dragon2 = new Image();
dragon2.src = "images/oldtraff2.png";
var dragon3 = new Image();
dragon3.src = "images/trees2.png";
var dragon4 = new Image();
dragon4.src = "images/f12.png";
var dragon5 = new Image();
dragon5.src = "images/nem2.png";
var dragon6 = new Image();
dragon6.src = "images/nl2.png";
var dragon7 = new Image();
dragon7.src = "images/dino2.png";
var dragon8 = new Image();
dragon8.src = "images/ipad2.png";
var dragon9 = new Image();
dragon9.src = "images/tokyo2.png";
var dragon10 = new Image();
dragon10.src = "images/pup2.png";
Im having trouble with my js. I have a series of img tags. each one needs to run a function with the onclick event. In the function I want to copy the src of the image into the src of a main -larger- img tag. I tried something like this: function doit(){
var node = this; var dest_div = document.getElementById("bigimagediv");
I tried this but its 'not a function' =/ function doit(){ var node = this; var nodesrc = node.getAttribute("src"); dest_img.setAttribute("src", nodesrc); }
but it doesnt work. I _do_ want to the keep the image thumbnail on the page, so maybe a copyNode or something else.
I have small issue with the below javascript code. I am trying to create a button which copies the text of one field into another text area. This works fine at the moment but now I want to copy the text into the textarea instead of overwrite the value which was entered previously.
I have 2 textboxes (textbox1 and textbox2) and one hidden field (hidden). I want the value of the hidden field to be both values of textbox1 and textbox2 separated with "-".
how to copy an input field to an input field using a check box, what I want to do is copy data from an ID that has been populated with data using ajax and then select which data I want to copy depending on the drop down option selected. I can get the drop down box to alert the same data back that I want to copy but I can't display that data inside the input field.
step by step:
1. search for data with ajax and populate ID with data
2. use drop down box to select data to copy and copy it to input field
Tutorial I read
HTML CODE
This is the ID that already has data retrieved using ajax.
I know it's messy and all to send data this way, but it's what was decided on, so here's what I need to do with it. I want to take all the info from the query string and post it into the corresponding form fields in the document. So I need to somehow isolate the query string (maybe a global JS variable? maybe another method?) and then I was thinking it would work to somehow pull each piece of information delimited with &= and put them into a simple array (split() method?). Once I have the info pulled from the URL into an array, I thought I could simply update the field's value attribute with basic javascript like this:
form1.SubscriberID.value=1523;
Then, all the values would be automatically loaded into the correct form fields. But, since I'm a js newbie, I really dont know how to go about this. Ideas? Examples? Remember I'm new, so explaining every process might be in order.
Visit [url]. I want to to save 32 stations grid in exactly the same format or better yet be able to somehow copy it in excel w/out going into the source and manually editing it. How is this possible?
I'm having users fill out a form where there are multiple rows of data.
Some of the rows can have duplicate data for some fields.
So say on line 1) i have first name, last name as an input fields and some other fields as well, c, d, e, etc.
When the user gets to line 2) if they want to have the same first name and last name as line 2, can I have them check a box and it will automatically populate these fields with the info they just typed in line 1? I can't figure out how to do this.
does anyone know how to apply onselectstart and ondragstart to just one image on a page?
All of the posts I have found so far suggest adding these to the body tag. The disadvantage of this is that it prevents users from selecting anything at all on the page.
I need to isolate this to one particualr image. I've tried adding the selectstarts to divs, the img tag etc but it doesn't seem to work.
This may seem an odd question, but is it possible to write a script in JavaScript or even Java to copy an image from one browser window and paste it somehow in another window? Or is it impossible for security reasons?
I paid for some to create a slideshow, and it works fine in the orginial html document but when i copy and paste the code into my html document the scroller to the left of the image stops moving up and downI put the working file at thisthe guy i paid to do work refuses to help even those i advertised the price in my ad and he wanted me to give to pay him more to tell which code to change
I am using ContentFlow from [URL] It is very well documented on their website. I got the whole thing working great on my site. What I don't know is how to change the ActiveItem onclick to just bump it over to the next image as if the next image had been clicked. As of right now it opens the image source in a self window. I don't want that. Can anyone give me a clue or maybe the whole answer on how to get it to click over to the next image? I believe the answer lies in the contentflow_src.js file.
From any page, I want to be able to call a JS function that will do the equivelant of select all, and copy. This data will then be posted to a page that will log it.
This would be easy using copy/paste functionality but I don't want to screw-up users copy/paste buffer. Anyone have an example of how to retrieve all text with similar formatting of copying page to notepad without using copy/paste functionality?
I am trying to make a point and click javascript game. Basically what I want is to have one image displayed on screen at the start (room1.jpg). When you click on a door on that image, I have an onclick event to change the image to a new one that shows the door open (room1_a.jpg). What I want is that when you click the now open door, to display the next room in the game. The only solution I can think of is some sort of nested onclick event using several image maps, but I am fairly new to Javascript and I am not sure if that is possible. What it all comes down to is I want to display each incarnation of each room in the game in the same window without having to reload a new window for each room. I hope that makes sense, if not I can try and clarify. Below is the code I have so far. And as you can see all that does is display the open door when you click on the image. I have not done any of the image mapping yet.
I'm trying to use javascript to load an image on a webpage when another image is clicked on, just like an image gallery and just like this except I don't need any text: [URL] I copied the example above but when I click on the smaller image to load the larger one it works for a fraction of a second (I can see the image load in the right spot), but then the browser goes to the URL of the image instead (showing it on a blank page).
I want the user to input their name and email address. after that, if they select a yes radio button, it means their data is in the db so I need to grab that data from the DB, and display it in different text fields. I am using Cold Fusion as my main language.
I was wondering if you can run a sql query in JS based around the email form field data, then get the data back, and use the returned data to populate the many fields on the page?
Im looking to basically have an image which is a button with a value, and when i click the image, it gets replaced by another image with a different value. when clicked again it would return to the original image and value..Is this possible? and if so, please help cos im terrible at javascript!
I should warn, i know almost nothing about javascript. i've been trying read sample scripts and examples on how to modify this script; but I just don't know enough. I have a script that pulls data from an array, and copies it directly to the clipboard when a user clicks on it. The problem is this only works in IE, because Firefox doesn't by default allow that to happen. I'm trying to change it so that when it is clicked, instead, it takes what was going to be copied to the clipboard, and puts it in a Prompt box for the user to copy and paste. I had other scripts that do that, but I can't for the life of me figure out how to learn from it!
I have a close buttons wich removes the element from dom: $("#element").fadeOut('fast').empty().remove();
The second time I execute the onclick event, the first code takes approx 1 second, so much slower. The php code execution time is the same as previously.
Should I disable the right click option or not? I have a gallery site, I don't want people to be able to copy the images with the default right click over an image. From a professional looking site point of view I suppose I would be messing with the functionality a bit too much, OR is it OK in this instance to disable the click. I know how to write the code to disable the click, but what I was thinking was maybe it would be better to leave the right click but change the menu options? I'm not sure how to change the menu options ere is a link to the site. [URL]
I have a number of images whose src's are changed when a button is pressed. At the moment the href is also changed and the images are opened. However I have a function which opens the images in their own windows. I want to run this for each image using the onClick event of the image. I have all the images and links stored in there own array's. I would like to do the same for the onClick events. I have tried creating an array an storing the onClick events in it.
i.e. images_onClicks[2] = "image_popup('image.jpg',100,100,100,100)"; and then changing the onclick event for the image. i.e. document.getElementsByName("image1")[0].onclick = images_onClicks[0];
However I just can't get it to work. Could anyone please tell me if there is something that I am missing.