Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

drag image properties to textfield

Posted on 2003-11-18
5
Medium Priority
?
257 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
4 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
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:
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Suggested Courses

876 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