gotcha41
May 5 2005, 09:16 PM
| | when some images get clicked, a text should added to an input(textfield). Does someone know how this can be done? I suppose it can be done via javascript. thanks in advance! If you need more information, just ask  |
Reply
whyme
May 6 2005, 12:32 AM
gahhhh, i had a script like this, but then i completely lost it! I'm positive that you can find a script like that at hotscripts.com dang it, i can't believe i forgot that script... it's something like: OnMouseClick then document.write something....
Reply
SystemWisdom
May 6 2005, 12:47 AM
That would be simple enough using the Document Object Model of HTML and JavaScript.. A javascript function could access nearly any element in the page, and at any time, so an image being clicked would be a good time! Basically, how it works is by giving the element you want access to an ID with the id="" attribute. Then you can get a direct reference to that element by using the ID with the getElementById() function that is part of javascript. Once you have access to the element, you can change its Value property to display any text you want. Wrap that in a function, and call it in the onclick event of an image. Here is an example: CODE
<html>
<head>
<title></title>
<script type="text/javascript" language="javascript"><!--
function ChgText() { var MyElement = document.getElementById("MyTextBox"); MyElement.value = "If you see this, it worked!";
return true; }
//--></script>
</head>
<body>
<br><br> <center> <img src="my_image.gif" alt="Click Me!" onclick="ChgText()" />
<br><br><br>
<input type="text" size="35" id="MyTextBox" value="" />
</center>
</body> </html>
I hope that helps!
Reply
gotcha41
May 12 2005, 09:08 AM
ok, thanks ! You provided the code i was looking for this topic can be closed now? question answered/problem solved.. btw: Systemofwisdom, i've raised your reputation with one point ! keep up the good work.
Reply
Recent Queries:--
html onclick for image - 3.57 hr back. (1)
-
input image button adds - 5.21 hr back. (1)
-
onclick with image change - 5.69 hr back. (1)
-
adding text inside input html text - 6.73 hr back. (1)
-
onclick on image text display - 11.17 hr back. (1)
-
onclick to text field - 11.31 hr back. (1)
-
javascript image onclick event - 11.76 hr back. (1)
-
insert imaeg in input text field - 12.43 hr back. (1)
-
html input text onclick - 14.65 hr back. (1)
-
javascript onclick image - 14.74 hr back. (1)
-
onclick image new window - 15.10 hr back. (1)
-
changing image onclick with javascript input - 15.81 hr back. (1)
-
javascript write document "add input" onclick - 16.61 hr back. (1)
-
how to call a function in text field with type image - 17.26 hr back. (1)
Similar Topics
Keywords : onclick, image, add, text, input, text, field
- Image Rotater
need help (2)
Text Image Java Problem
How to include text and image in some scrollable container? (1) Hello everyone, I am just writing some kind of text editor as practice for some school project and I
have come to certain point where I can not solve certain problem. I wanted to make it available
for people to insert images but I cannot figure how to combine images and text and which container
should I use. I am working in Java and using swing. Also I would like to say that this content
should be scrollable. So if anyone knows something about this and could be able to help me thanks in
advance. Everyone opinion is accepted.....
How To Make This Type Of Link?
Image change on mouseover (1) I cant figure out how to solve this problem.... I want to make link to be like this: When the page
is loaded to have a pictures on it, but one picture is a link. I want to make this picture to change
when I get my mouse cursor over her... I mean: when my mouse cursor is not on a picture then on page
is loaded a "pic1.gif" file, but when my mouse cursor is over it, picture changes to a "pic2.gif".
Thanks for help!....
Help Writing An Html Code (onclick Open Something)
(5) hi, I am new in web development i want to make a page in which there are few buttons and on click
of each button there is some hidden text field which becomes visible and user can enter the text he
wish to in it. how can i ?....
How Do You Make Text In A <div> Change When You Click On A Link?
something to do with jvascript (4) Say I have a link and some text. How would I make it so that when I clicked on the link, that text
changed?....
Expanding Image Gallery
Images Expanding on a mousover (6) I was looking through wired today, and i noticed :
http://www.hotwired.com/webmonkey/06/08/index2a.html looks like a pretty nifty image gallery
effect, though i noticed that it wont display properly in FireFox. Does anyone have any links or
examples of other image gallery code, i find it pretty fascinating.....
Countdown Code Help
I need help setting an image as the background. (3) Ok, now for scripts like this i am not to well of working with..and i am in need of a bit of help, i
would like to set a background image as the background not a color... CODE <script
language="JavaScript1.2"> /* Dynamic countdown Script- © Dynamic Drive
(www.dynamicdrive.com) For full source code, 100's more DHTML scripts, and TOS, visit
http://www.dynamicdrive.com */ function setcountdown(theyear,themonth,theday){
yr=theyear;mo=themonth;da=theday } //////////CONFIGURE THE COUNTDOWN SCRIPT HERE//////////////////
//STEP 1&....
Link In Search Form
Open a link inside a text area... (2) i added a javascript search to my site Search basically i wanted to have links on there so that
when u click the link it runs the search. instead of making ppl type it into the textarea and
clicking go. or have it so when u click the link it enters text into the text area and then
searchs... anyone know what im chatting about? ~thanks Please make sure that Topic title has to
be descriptive. ....
Button To Display An Image
(1) I have an assignment that is due tomorrow that I am struggling with. I want to be able to click the
next button in this applet, and then repaint all the graphics. Board contains an array with all of
the chess pieces on a board, and when the button is clicked I want to be able to get the next move,
but for now I just wanted to call a function to move one piece just so I know it's working. Here
is my applet code, I could post all the other files, but I am almost positive they all work
correctly, and I am just having trouble with the applet. Code: CODE import java....
Problem To Update Jlabel With A Different Image..
(1) Hi All, I am inplementing a preview function on a image file browser. The application displays a
list of image file names, which the user can select (one at a time). The preview image is loaded
into a JLabel. When an image file name is selected, the application creates a thumbnail image on the
hard drive call "preview.jpg". The JLabel should then update itself with the newly created thumbnail
"preview.jpg". For some reason I cannot get the Image in the JLabel to update. I have confirmed
that "preview.jpg" is being rewritten, each time a new image file is selected from ....
Writing A Text File On Wen Host
write to the text file on the webhost (1) Hi! i need to write a text file with applet on the wen host. It is like a guest book that the
visitor enters his comments and the comments are stored in the text file. I found a website which
presents a method to write text files to the visitor's computer but i need to write the text
file to the webhost the applet is hosted. its like a log file or a guest book. I know there is a
way and it can be done but i can't figure it out! Any help would be appreciated!
Thanks! kvarnerexpress Topic title and description are VERY import to this forum. Edit ....
How To Store The Text Typed In A Form?
sort of newsletter subsciption form (5) i would like to add a form on my site, that let's you fill in your e-mail address in order to
subscribe to a newsletter. Actually, i just need to see their addresses somewhere (in a textfile,
database, forward to my e-mailaddress,..). How can this be done? I mean, which script do i have to
use? There is a database available. Php is enabled. I have no acces to cgi-bin, if that's
needed. I hope someone can help me with this. The alternative would be that there is a link on my
site so that they can mail it to me, but prefer a script /smile.gif' border='0' styl....
Image Clocks
(2) Does anyone know how to make you r own image clock (like a skin) for your website. The time displays
like your system. you might take a look a this to know what i mean. So-You.net click here to see
what i mean ...image clocks ....
Onclick & Ie
The not so new standards problem (1) I want to do some action when I click on a paragraph (for example). Here is the code: CODE ...
<script> function refresh_data(){ alert ('test'); }
</script> <p onClick='refresh_data();'>Refresh</p> ...
This works perfect on Firefox and on IE 6.0 and greater. The fact is, it doesn't work on IE 5.0.
What should I do? Re-design everything to allow all kind of browsers (including those not so old and
much used like IE5.0) or recommend users to upgrade their borwsers?. On an Intranet servi....
Image Show With Thumbnail And Fade
Does anyone know were I can get this code? (2) Hi I would like to know if anyone knows a javascript that makes an thumbnail 'slideshow'
and when mouseover...it fades...and when you click...it enlarges!!! I saw it somewhere
here on the net but i cant finf it anymore!!! Can anyone help me...or does anyone know
a good javascript site???? THANKS ....
Resize Image Before Uploading
(0) Hi, My upload and resizing scripts are working perfectly. Problem is clients are uploading large
files and the script times out or connection timeout. Problem is with the bandwith and the slow
connection in South Africa. I have increased the script timeout but it simply takes too long to
upload. Clients forget that most didgital cameras files are massive and if they simple resize
before uploading it will save them a huge amount of time. The final file is only 280 X 210 pixels.
Uploading a 5Mb file over a 56k connection takes a month of Sundays. I have detailed instr....
Rollover Background-image Button Ie
Rollover background-image button IE (0) I find This Code On Search I Think for webmasters is good To Find Easy this Kind of code so i Type
it here I Hope U enjoy it /blink.gif' border='0' style='vertical-align:middle' alt='blink.gif' />
Step 1: Insert the below into the section of your page. Change the image path within ".initial"
to reference the image you want applied initially to the button. .initial{ font-weight:bold;
background-image:url(first.jpg); } CODE <script type="text/javascript">
<!-- //Specify optional button target: "_new" for new window, ....
Where Do I Put The Text?
(0) I actually downloaded this menu applet from Magic Rainbow Buttons I made my own image to use for
the eye HERE My question is how do I insert text? and where exactly?? here's the source:
<!--param name=transition-frames value=20> HERE'S The text edit I
use: // Create a menu.txt file using the index editor "text:" "1" "" "" "" "text:" "1" "" "" ""
"text:" "1" "" "" "" "text:" "1" "" "" "" "text:" "1" "" "" "" "text:" "1" "" "" "" "text:" "1" ""
"" "" "text:" "1" "" "" "" "text:" "1" "" "" "" "text:" "1" "" "" ""....
Reading From A Text File
(8) Reading from a text file whats up guys, got some more questions. we are starting to learn how to
write and read strings to/from txt files. wel thats pretty easy, but how would i retrieve only the
first 2 lines of the txt file, for example, if i wanted the first 2 lines, not any other, how would
i do it: 12 90 12 6 -9 how would i go baout doin this. thnks ke....
Image Scroller?
(6) does anybody know where i can find a image scroller script? scrolling up and down?....
Glowing text on mouseover...
java scripting .. (4) One more script for today ... /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0"
alt="biggrin.gif" /> The text glows on mouseover of the page which will draw the eyes of your
visitor. Good to use on important lines of text that you want noticed. The colors can be changed
easily to blend in with your background color, as can be the font style and size. Installation:
STEP 1: Copy the code below and paste this into the of your html document. Comments have been
inserted where you change the text size, type and colors at the top part of the scr....
Looking for onclick, image, add, text, input, text, field
|
|
Searching Video's for onclick, image, add, text, input, text, field
|
advertisement
|
|