/    Sign up×
Community /Pin to ProfileBookmark

Help with dropboxes and links

I’m trying to put the selected value of a dropbox into a link to a perl script. What I’m looking for is something along the lines of this:

[code=html]<select name=”dropbox”>
<option value=”Huey”>Huey</option>
<option value=”Duey”>Duey</option>
<option value=”Louie”>Louie</option>
</select>

<a href=”perlscript.cgi?action=blah&user=DROPBOX VALUE HERE>blah</a>
<a href=”perlscript.cgi?action=geh&user=DROPBOX VALUE HERE>geh</a>[/code]

I hope that gets the idea of what I’m trying to do across. Does anyone know how to do this?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@cyber1Aug 29.2005 — Try this:
[CODE]<a href="#" onClick="getDataHref('purge',document.main.file.options[document.main.file.selectedIndex].value)">purge</a> |
[/CODE]

main = your form name

file = your select list name


In my case I needed to do some other things as well so I also had a function in the head section

function getDataHref(loc,file){

this.location.href='$cgi_url/$this_scriptname?'+loc+'=1&file=' +file

}

I think it could be done as a one liner though.

-Bill
×

Success!

Help @rafgar spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...