Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 1st, 2004, 04:47 PM
cliffhanger9's Avatar
cliffhanger9 cliffhanger9 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: city of sin, state of the art
Posts: 421 cliffhanger9 Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 19 h 41 m 11 sec
Reputation Power: 0
Send a message via ICQ to cliffhanger9 Send a message via AIM to cliffhanger9 Send a message via MSN to cliffhanger9 Send a message via Yahoo to cliffhanger9
Question Download File Script based on form options

hey all!

i am making an image gallery where people can pick the details of the image that they want and then click a button and based on the values that are entered they will download a certain image

so i have this form...

6 radio buttons and a submit.

O - 72 dpi
O - 150 dpi
O - 300 dpi

O - color
O - black
O - white

(Submit)

so then the idea would be if they select 150 dpi - black then they would download that proper file, say image1_150_blk.jpg for example

i dont think it is too hard but yea i dont really know a whole lot of javascript so i could be wrong...but its a fun little project and i would sooo appreciate it if anyone has a script for this, or if you know what you would call this so i could search for it!! i would greatly appreciate ANY advice!!!

thank you thank you thank you in advance!!!

ROCK ON!!

(yes i posted this to the javascript forum but people in there are mean and despite the 22 views no one was kind enough to even reply! thanks!!!! )
__________________
"I hate quotations."
-ralph waldo emerson-

Reply With Quote
  #2  
Old February 18th, 2004, 07:50 AM
Detrifuse's Avatar
Detrifuse Detrifuse is offline
Bites when cornered
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Back from Iraq!
Posts: 109 Detrifuse User rank is Corporal (100 - 500 Reputation Level)Detrifuse User rank is Corporal (100 - 500 Reputation Level)Detrifuse User rank is Corporal (100 - 500 Reputation Level)Detrifuse User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
Must have missed it in the other forum, but something similar to this should work:
Code:
<script>
function do_image()
{
	if(document.forms.myform.d72.checked) { var res = 72; }
	if(document.forms.myform.d150.checked) { var res = 150; }
	if(document.forms.myform.d300.checked) { var res = 300; }

	if(document.forms.myform.c1.checked) { var color = "clr"; }
	if(document.forms.myform.c2.checked) { var color = "blk"; }
	if(document.forms.myform.c3.checked) { var color = "wht"; }

	var image_url = "myimage_" + res + "_" + color + ".jpg";
	window.location.href = image_url;
}

</script>
<!-- Then the form: !-->
<form action="#" method="get" name="myform">

   <input type="radio" name="dpi" id="d72" value="72" checked> - 72 dpi<br>
   <input type="radio" name="dpi" id="d150" value="150"> - 150 dpi<br>
   <input type="radio" name="dpi" id="d300" value="300"> - 300 dpi<br>
<br>
<br>
   <input type="radio" name="color" id="c1" value="clr" checked> - Color<br>
   <input type="radio" name="color" id="c2" value="blk"> - Black<br>
   <input type="radio" name="color" id="c3" value="wht"> - White<br>

   <input type="submit" value="download" onclick="do_image(); return false;">
</form>



HTH
__________________
Obstruct the doors, cause delays, be dangerous.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > Download File Script based on form options

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap