1

I would like to set the default of a drop-down menu of a webpage by passing the default value in the url.

Id like to put a link on a another webpage to this site where the: "I would like my contribution to go to:" option is set to Pakistan: moonsoon floods e.g. by doing something like:

http://donate.ifrc.org/?desc=Pakistan: monsoon floods

but this doesnt seem to work. Any ideas i want to put up this link to get as many people to donate as possible. Thanks.

~f

5
  • Paste the code you have so far? Commented Aug 15, 2010 at 23:59
  • the default is currently haiti Commented Aug 16, 2010 at 0:12
  • 2
    What language are you programming in? PHP? Ruby? Commented Aug 16, 2010 at 0:14
  • 1
    @Paul: as per the site's response headers, he's using ASP.NET. @Farhan: this isn't a HTML problem. It's just a dumb markup language. You can't execute some code logic with HTML. Your answer is in the server side view technology which is programmatically generating/composing/sending all that HTML. If it's indeed ASP.NET, you should tag your question as such. The answer is in there (or in JavaScript, but that would IMO more be a workaround than a real solution). Commented Aug 16, 2010 at 0:27
  • unfortunately the page is not mine so i cant edit the html. I would just like to post a link to it on my blog so that when people click it should load the page with the dropbox already set to monsoon as opposed to haiti. Remember i have no server-side capability the only thing i can play with is the url since this is not my page. Commented Aug 16, 2010 at 1:10

1 Answer 1

2

Unless the site you are linking to has specifically included code on their pages to support it, you are not going to be able to control how their site performs by changing the URL.

If you were trying to do this on your own site, you could easily do it by referencing the querystring parameters in whatever server-side language you built the site with, or on the client-side via Javascript. But in either case, the site itself controls how it responds to a URL, not the other way around.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.