Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

drag image properties to textfield

Posted on 2003-11-18
5
Medium Priority
?
256 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
D_M_D earned 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

705 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