View Full Version : Selection as an input into a text box
Hi there,
I require some assistance.
Basically, I have an online store that allows customers to view photographs and to order them off the website.
I need to be able to allow the customer to select the photos, and then the selected images names get put into a text box.
It sounds simple, but I can't find a way to do it.
All help will be greatly appreciated.
The store can be located at:
http://www.rsquared.co.za/store/htdocs/checkout.html
The text box is "Comments/Special Instructions:"
I would preferably like some sort of pop up, that once the photo's are selected, the client clicks "Confirm" and all the images that he/she has selected are put in the box (As TEXT).
Thanks once again,
Wolf
Medyman
02-19-2009, 08:16 PM
It seems like you have a shopping cart already in place. Can you not access that information?
Im not sure I understand what you are asking?
Access what information?
Medyman
02-19-2009, 11:23 PM
If I go to http://www.rsquared.co.za/store/htdocs/ and click "buy now" for any of the items, it adds the item to the shopping cart. Then on the page that you linked to, it has the product id, description, total, etc...
Are you looking for an alternative to this? Or are you just looking for a way for that information to be emailed to you?
If you have a look at this page:
http://www.rsquared.co.za/store/htdocs/checkout.html
Right at the bottom, there is an option for:
"Comments/Special Instructions:"
What I would like to do, is have a pop up that has a whole bunch of photos of a specific event, in specific folders (I'm a photographer).
The client the selects the photo's they want, with tick boxes. They click Submit, and all the image names that they selected appear in that text box.
Not sure if I can explain it any more than that :confused:
Medyman
02-19-2009, 11:37 PM
Ahh, I see. Then that page really has nothing to do with the functionality. I was confused by your existing shopping cart functionality.
There are a myriad of ways of going about it. It would really depend on how the rest of your system is set up.
In the very simplest form, you could use some basic JavaScript that takes values from checkboxes, appends them to some value and sets that value equal to the value of the comments box. Here (http://www.somacon.com/p143.php) is one example of how to do this, though basic.
As I said, it would depend on how your current work flow is and how advanced you want to make the form.
Basically,
Select images.
Image names that are selected: Input into text box
I would have no idea where to start!
Medyman
02-20-2009, 12:07 AM
Right, I understood.
The easiest place to start would probably be with the HTML. You would first create the form with a checkbox related to each image.
<input type="checkbox" name="image1" />
The user would then select all the images he wants.
Next you would use jQuery (http://jquery.com/) to loop over all of checked input[type='checkbox'] elements (http://docs.jquery.com/Selectors/checked). You would then take the name attribute (http://docs.jquery.com/Attributes) of the elements, concatenate them (http://en.wikipedia.org/wiki/Concatenation) and then set them equal to the value (http://docs.jquery.com/Val) of the textarea.
Finally, email it off using some PHP (http://www.thesitewizard.com/archive/feedbackphp.shtml).
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.