a problem with a form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • james

    a problem with a form

    I hoping someone can help me.

    What I have is a series of drop down forms, they are dates and other things.
    What I need to do is get these values and input them into a URL string in a
    certain order.

    I have been trying to get this to work for ages. I think I have the function
    done correctly for the for I just can not get it into the url string.

    Can someone please help

    James


  • james

    #2
    Re: a problem with a form

    Here is a little more information.

    The form I have is a booking form for a hotel. I need to link it to a
    central booking service with the following URL string



    Using this url. But what I having trouble doing is getting the information
    from my from into the string. I hope this extra info helps



    James
    [color=blue]
    > I hoping someone can help me.
    >
    > What I have is a series of drop down forms, they are dates and other[/color]
    things.[color=blue]
    > What I need to do is get these values and input them into a URL string in[/color]
    a[color=blue]
    > certain order.
    >
    > I have been trying to get this to work for ages. I think I have the[/color]
    function[color=blue]
    > done correctly for the for I just can not get it into the url string.
    >
    > Can someone please help
    >
    > James
    >
    >[/color]


    Comment

    • lallous

      #3
      Re: a problem with a form

      Hello,

      "james" <james@lego.co. dk> wrote in message
      news:br6il6$qog $2@sparta.btint ernet.com...[color=blue]
      > I hoping someone can help me.
      >
      > What I have is a series of drop down forms, they are dates and other[/color]
      things.[color=blue]
      > What I need to do is get these values and input them into a URL string in[/color]
      a[color=blue]
      > certain order.
      >
      > I have been trying to get this to work for ages. I think I have the[/color]
      function[color=blue]
      > done correctly for the for I just can not get it into the url string.[/color]

      After you have formed the URL into a string you can pass it to URL as:
      location = myNewUrl;
      Fetch more info about the 'location object' in some online reference.
      [color=blue]
      >
      > Can someone please help
      >
      > James
      >
      >[/color]


      Comment

      • Richard Cornford

        #4
        Re: a problem with a form

        "james" <james@lego.co. dk> wrote in message
        news:br6il6$qog $2@sparta.btint ernet.com...[color=blue]
        >What I have is a series of drop down forms,[/color]

        A "drop down form"? That's a new one, you may have to
        elaborate/illustrate.
        [color=blue]
        >they are dates and other things. What I need to do is get
        >these values and input them into a URL string in a
        >certain order.[/color]

        The order of the name value pairs in a query string should not matter in
        the slightest. Unless someone has done a really bad (deliberately
        stupid) job of authoring the CGI script it is sent to, in which case
        they should be told to fix it.

        A form, provided with an ACTION attribute set the URL of the CGI script
        and a METHOD attribute set to GET will, when submitted, automatically
        append the query string to the URL, suitably encode the data as
        required, and make a GET request to the CGI script with the resulting
        URL. The exact order of the name value pairs should reflect the order of
        the named form elements in the HTML, though I wouldn't rely on that,
        but, as I have said, the order should not be important at all.
        [color=blue]
        >I have been trying to get this to work for ages. I think I
        >have the function done correctly for the for I just can not
        >get it into the url string.[/color]

        If you want help changing code that you have written so that it does
        what you want it to do you will have to allow access to the code, and
        provide an HTML context in which it can be tested. (that is: post the
        code or the URL of an online version so people can have a look at it).

        Richard.


        Comment

        • Evertjan.

          #5
          Re: a problem with a form

          james wrote on 10 dec 2003 in comp.lang.javas cript:
          [color=blue]
          > I hoping someone can help me.
          >
          > What I have is a series of drop down forms, they are dates and other
          > things. What I need to do is get these values and input them into a
          > URL string in a certain order.
          >
          > I have been trying to get this to work for ages. I think I have the
          > function done correctly for the for I just can not get it into the url
          > string.[/color]

          Others will tell you why it is not very necessary,
          I will show you it van be done,
          forgetting even to use the <form> element:

          <SELECT id="first">
          <OPTION value="1">one
          <OPTION value="2">two
          </SELECT>

          <SELECT id="second">
          <OPTION value="3">three
          <OPTION value="4">four
          </SELECT>

          <button onclick="doURL( )">
          do it
          </button>

          <script>
          function doURL() {
          nfirst=document .getElementById ("first").va lue
          nsecond=documen t.getElementByI d("second").val ue
          t="http://thisismysite.co m/second="+nsecon d+"&first="+nfi rst
          alert(t)
          location.href=t
          }
          </script>



          --
          Evertjan.
          The Netherlands.
          (Please change the x'es to dots in my emailaddress)

          Comment

          • james

            #6
            Re: a problem with a form

            Thanks for that, It works great, is there anyway I can get it to do
            something simillar to target="_blank" ?


            "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
            news:Xns944DA31 752C0Deejj99@19 4.109.133.29...[color=blue]
            > james wrote on 10 dec 2003 in comp.lang.javas cript:
            >[color=green]
            > > I hoping someone can help me.
            > >
            > > What I have is a series of drop down forms, they are dates and other
            > > things. What I need to do is get these values and input them into a
            > > URL string in a certain order.
            > >
            > > I have been trying to get this to work for ages. I think I have the
            > > function done correctly for the for I just can not get it into the url
            > > string.[/color]
            >
            > Others will tell you why it is not very necessary,
            > I will show you it van be done,
            > forgetting even to use the <form> element:
            >
            > <SELECT id="first">
            > <OPTION value="1">one
            > <OPTION value="2">two
            > </SELECT>
            >
            > <SELECT id="second">
            > <OPTION value="3">three
            > <OPTION value="4">four
            > </SELECT>
            >
            > <button onclick="doURL( )">
            > do it
            > </button>
            >
            > <script>
            > function doURL() {
            > nfirst=document .getElementById ("first").va lue
            > nsecond=documen t.getElementByI d("second").val ue
            > t="http://thisismysite.co m/second="+nsecon d+"&first="+nfi rst
            > alert(t)
            > location.href=t
            > }
            > </script>
            >
            >
            >
            > --
            > Evertjan.
            > The Netherlands.
            > (Please change the x'es to dots in my emailaddress)[/color]


            Comment

            • Evertjan.

              #7
              Re: a problem with a form

              james wrote on 10 dec 2003 in comp.lang.javas cript:[color=blue][color=green]
              >>
              >> <button onclick="doURL( )">
              >> do it
              >> </button>
              >>
              >> <script>
              >> function doURL() {
              >> nfirst=document .getElementById ("first").va lue
              >> nsecond=documen t.getElementByI d("second").val ue
              >> t="http://thisismysite.co m/second="+nsecon d+"&first="+nfi rst
              >> alert(t)
              >> location.href=t
              >> }
              >> </script>
              >>[/color]
              > Thanks for that, It works great, is there anyway I can get it to do
              > something simillar to target="_blank" ?
              >[/color]

              [Please do not bottomquote on usenet]

              sure, exchange:

              location.href=t

              with:

              window.open(t," _blank","")

              --
              Evertjan.
              The Netherlands.
              (Please change the x'es to dots in my emailaddress)

              Comment

              Working...