Solved

drag image properties to textfield

Posted on 2003-11-18
5
251 Views
Last Modified: 2009-12-16

Hello Experts...

Does anyone know how I can (or even if it's possible) click on an image that is display on the page and drop its properties into a textfield.

Wow... that sounds impossible...

Here's what I have.  On my web page I am displaying a number of images.  These image names are all store in an Access database and I just use Javascript to create an array of images and display this array on the page.  Users can scroll up and down this array of images. It's really cool.  I am creating a page where the user can basically type an image name with extension into a textfield on a "user control panel" form. The form will allow users to display images on their personal page. When the user submits the form the textfield value gets assigned to an image <img src="#image#" alt="image variable" /> that will display on the user's screen.  

Rather than have the user type in the actual image name into the textfield I'd like to see if it is possible to highlight and drag an image into the textfield and have the image name appear.  I can do this if I highlight and drag the image name written in text below the image..basically copy and paste.  But I don't don't if there is a way to do this with just an image.  

Maybe it is impossible and perhaps the images need to be displayed on the page a different way...  

Well you all are the experts so I pose this question to you...

Thanks in advance to looking at this....

p.s. Oh I am using cold fusion and javascript on this page.  Don't know if that will have any relevance.
0
Comment
Question by:shogun5
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
D_M_D earned 250 total points
ID: 9779087
You can add a checkbox next to each image and have the user check the image they want and the value of the check box can be the image name (which you have as text now).  Then use Javascript to populate the text field when the user checks a checkbox.

<input type="checkbox" name="img1" value="<script lanugage="JavaScript">document.write(arrayImageName)</script>" Onclick="MoveImageName(img1);">

<script language="JavaScript">
function MoveImageName(imagename){
    // short version
   document.all.textfield.value = document.all.img1.value;
}
</script>


this is just an idea, you will need to name each checkbox in order (ie... img1,img2 etc...)
-------
D_M_D
0
 

Author Comment

by:shogun5
ID: 9783494
D_M_D ,

Thanks dude for your comments...

Yeah, I decided to do the same thing but instead of putting a checkbox next to the image I just click on the image (attach an onClick event to the image) itself and the same of the image gets displayed on the texfield.

I guess the drag and drop idea is a bit overwhelming....

Thanks again....

-mike
0
 
LVL 10

Expert Comment

by:D_M_D
ID: 9787035
That definetly works.  The drag and drop idea probably could work, but would take alot of coding.  good luck.

--------
D_M_D
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 11432228
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    Accept: D_M_D {http:#9779087}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

pinaldave
EE Cleanup Volunteer
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question