Solved

drag image properties to textfield

Posted on 2003-11-18
5
255 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 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

627 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