chrism
chrism

Reputation: 2933

Submit a radio button as a file input

I have a set of radio buttons with values like this:

<input type="radio" value="http://www.foo.com/image1.jpg" />
<input type="radio" value="http://www.foo.com/image2.jpg" />
<input type="radio" value="http://www.foo.com/image3.jpg" />

But on submit I'd like it to treat the selected radio as if it were a file input, using the value as it's value. I'd also like to do this with only HTML if at all possible, but if not I'm willing to use jQuery. Any thoughts?

Upvotes: 2

Views: 221

Answers (1)

DVK
DVK

Reputation: 129491

This will not work.

In order for something to work as file input, the file needs to exist on local filesystem - and you can not get your web page to automatically save the file from a URL to a filesystem due to JS security restrictions.

Upvotes: 1

Related Questions