开发者

get values from query string for input box and drop down menu

开发者 https://www.devze.com 2023-02-23 13:14 出处:网络
Hi I have the following page with a query string: http://userpages.umbc.edu/~andrade1/querystring/querystring/example1%20-%20Copy.html

Hi I have the following page with a query string: http://userpages.umbc.edu/~andrade1/querystring/querystring/example1%20-%20Copy.html

when I click show and go to the receiving page which is here: http://userpages.umbc.edu/~andrade1/querys开发者_开发技巧tring/querystring/example123.html?name=Duck%2C%20Donald&spouse=Daisy

How can I retrieve the query string so that the drop down menu will display the name which is donald duck or mickey depending which button was clicked and the input box will display either minnie or daisy depending which button was clicked?

For example when the show button for mickey mouse is clicked I want mickey mouse to display in the drop down menu but still be able to select other options after the page is loaded and I would like minnie to display in the input box but be able to also type in another value.

Currently the javascript that I am using is:

<script type="text/javascript">
        <!--
        document.write("Name: " + Request.QueryString("spouse"));

        // -->
    </script>

which does not work for a drop down menu or input box


use location.search

JavaScript query string

0

精彩评论

暂无评论...
验证码 换一张
取 消