make url with javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • autogoor@yahoo.com

    #1

    make url with javascript

    Hi,

    I have a web page for user to input rectangle dimensions, say (10, 10,
    100, 40), and then forward the information to a cgi with a url
    something like


    But the url generated is
    http://mydomain.com/cgi-bin/myapp?sh...C10%2C100%2C40.
    How can I fix it?

    thanks,

    autogoor

    Here is my html for the page

    <html>
    <head>
    <SCRIPT LANGUAGE="JavaS cript">
    function makeurl () {
    var url = document.para.x .value + ",";
    url = url + document.para.y .value + ",";
    url = url + document.para.z .value + ",";
    url = url + document.para.c .value;
    document.act.Di m.value=url;
    document.act.su bmit();
    }
    </SCRIPT>
    </head>
    <body>

    <form name=act action=http://mydomain.com/cgi-bin/myapp>
    <input type=hidden name=shpae value=rectangle >
    <input type=hidden name=Dim>
    </form>

    <form name=para>
    <table border=0>
    <tr>
    <td>Width</td><td><input type=text name=x></td>
    </tr>
    <tr>
    <td>Height</td><td><input type=text name=y></td>
    </tr>
    <tr>
    <td>Z-sections</td><td><input type=text name=z ></td>
    </tr>
    <tr>
    <td>Channels</td><td><input type=text name=c></td>
    </tr>
    <tr>
    <td></td>
    <td><input type="button" value="Create" onClick="makeur l()"></td>
    </tr>

    </table>
    </form>

    </body>
    </html>

  • Grant Wagner

    #2
    Re: make url with javascript

    <autogoor@yahoo .com> wrote in message
    news:1113704479 .273804.59150@o 13g2000cwo.goog legroups.com...[color=blue]
    > Hi,
    >
    > I have a web page for user to input rectangle dimensions, say (10, 10,
    > 100, 40), and then forward the information to a cgi with a url
    > something like
    > http://mydomain.com/cgi-bin/myapp?sh...m=10,10,100,40
    >
    > But the url generated is
    > http://mydomain.com/cgi-bin/myapp?sh...C10%2C100%2C40.
    > How can I fix it?[/color]

    It can't be "fixed", nor would you want it to be.

    When /cgi-bin/myapp reads the parameters, it should automagically URI
    decode the value of dim. If it does not, you will need to write your own
    decode or use one provided by the environment you are using on the
    server.

    --
    Grant Wagner <gwagner@agrico reunited.com>
    comp.lang.javas cript FAQ - http://jibbering.com/faq


    Comment

    Working...