Request.Form(var) empty with IE, works fine with Firefox. Help please.

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

    Request.Form(var) empty with IE, works fine with Firefox. Help please.

    Hi,

    I've been trawling the web for answer to my problem with no luck
    although I'm hardly alone it seems!

    Below is the generated source for an ASP page that posts a value called
    'album' to another ASP page. The other page retrieves the value with
    Request.Form('a lbum'); On Firefox this works fine every time. On IE6, I
    always get nothing. I'm pretty sure it's the posting side that is at
    fault, so that's what I've shown here. Oh, I tried Request.QuerySt ring
    too and again, fine on Firefox, nothing on IE6.

    Any help would be much appreciated.

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=windows-1252">
    <meta http-equiv="Content-Language" content="en-us">
    <title>Galler y</title>
    <!--mstheme-->
    <link rel="stylesheet " type="text/css"
    href="_themes/poetic2/poet1011.css">
    <meta name="Microsoft Theme" content="poetic 2 1011, default">
    </head>
    <body>
    <form name='albumsele ct' action="gallery _intro.asp" method="post"
    target="intro">
    <CENTER><h2>ALB UMS</h2></CENTER><hr><br>
    <CENTER><inpu t name='album' type=image src='photogalle ry/Test
    One/Title.jpg' value='photogal lery/Test One'
    onClick='submit ();'></CENTER>
    <CENTER>Test One Photos</CENTER><br><hr> <br>
    <CENTER><inpu t name='album' type=image src='photogalle ry/Test
    Two/Title.jpg' value='photogal lery/Test Two'
    onClick='submit ();'></CENTER>
    <CENTER>Test Two Photos</CENTER><br><hr> <br>
    <CENTER><inpu t name='album' type=image src='photogalle ry/Test
    Three/Title.jpg' value='photogal lery/Test Three'
    onClick='submit ();'></CENTER>
    <CENTER>Test Three Photos</CENTER><br><hr> <br>
    </form>
    </body>
    </html>

    Regards,

    Dave

  • Ray Costanzo [MVP]

    #2
    Re: Request.Form(va r) empty with IE, works fine with Firefox. Help please.

    Can you give your ASP code? Also, what's "submit()?" An <input
    type="image"wil l submit the form when clicked already.

    Ray at work

    "Dave" <dave@seafarete ch.co.ukwrote in message
    news:1157118656 .449405.142850@ p79g2000cwp.goo glegroups.com.. .
    Hi,
    >
    I've been trawling the web for answer to my problem with no luck
    although I'm hardly alone it seems!
    >
    Below is the generated source for an ASP page that posts a value called
    'album' to another ASP page. The other page retrieves the value with
    Request.Form('a lbum'); On Firefox this works fine every time. On IE6, I
    always get nothing. I'm pretty sure it's the posting side that is at
    fault, so that's what I've shown here. Oh, I tried Request.QuerySt ring
    too and again, fine on Firefox, nothing on IE6.
    >
    Any help would be much appreciated.
    >
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=windows-1252">
    <meta http-equiv="Content-Language" content="en-us">
    <title>Galler y</title>
    <!--mstheme-->
    <link rel="stylesheet " type="text/css"
    href="_themes/poetic2/poet1011.css">
    <meta name="Microsoft Theme" content="poetic 2 1011, default">
    </head>
    <body>
    <form name='albumsele ct' action="gallery _intro.asp" method="post"
    target="intro">
    <CENTER><h2>ALB UMS</h2></CENTER><hr><br>
    <CENTER><inpu t name='album' type=image src='photogalle ry/Test
    One/Title.jpg' value='photogal lery/Test One'
    onClick='submit ();'></CENTER>
    <CENTER>Test One Photos</CENTER><br><hr> <br>
    <CENTER><inpu t name='album' type=image src='photogalle ry/Test
    Two/Title.jpg' value='photogal lery/Test Two'
    onClick='submit ();'></CENTER>
    <CENTER>Test Two Photos</CENTER><br><hr> <br>
    <CENTER><inpu t name='album' type=image src='photogalle ry/Test
    Three/Title.jpg' value='photogal lery/Test Three'
    onClick='submit ();'></CENTER>
    <CENTER>Test Three Photos</CENTER><br><hr> <br>
    </form>
    </body>
    </html>
    >
    Regards,
    >
    Dave
    >

    Comment

    • Bob Barrows [MVP]

      #3
      Re: Request.Form(va r) empty with IE, works fine with Firefox. Help please.

      Dave wrote:
      Hi,
      >
      I've been trawling the web for answer to my problem with no luck
      although I'm hardly alone it seems!
      >
      Below is the generated source for an ASP page that posts a value
      called 'album' to another ASP page. The other page retrieves the
      value with Request.Form('a lbum'); On Firefox this works fine every
      time. On IE6, I always get nothing. I'm pretty sure it's the posting
      side that is at fault, so that's what I've shown here.
      If so, a client-side newsgroup would have been more appropriate (ASP only
      concerns server-side activity). But, read on ...
      Oh, I tried
      Request.QuerySt ring too and again, fine on Firefox, nothing on IE6.
      >
      Any help would be much appreciated.
      In the future, when posting html, remove everything that's not related to
      reproducing the problem, please. For example, we have no access to your
      style sheets, etc. so there's no need to show us those tags. Further: you
      have three image inputs with the same name. Does the problem only occur when
      you have more than one input with the same name?

      Here is my attempt to reproduce your problem (and yes, I did test the
      difference between one and more than one input):
      <%@ Language=VBScri pt %>
      <%
      if Request.Form.Co unt0 then
      Response.Write "Request.Form(" "album.x"") contains<br>"
      Response.Write Request.Form("a lbum.x") & "<br>"
      Response.Write "Request.Form(" "album.y"") contains<br>"
      Response.Write Request.Form("a lbum.y") & "<br>"
      else
      Response.Write "No Form variables"
      end if
      %>
      <HTML>
      <BODY>
      <form name='albumsele ct' method="post">
      <CENTER><h2>ALB UMS</h2></CENTER><hr><br>
      <CENTER><inpu t name='album' type=image src='images/vba3626.gif'
      value='photogal lery/Test One'
      onClick='albums elect.submit(); '></CENTER>
      <CENTER>Test One Photos</CENTER><br><hr> <br>
      <CENTER><inpu t name='album' type=image
      src='images/vba3626_2.gif' value='photogal lery/Test Two'
      onClick='albums elect.submit(); '></CENTER>
      <CENTER>Test Two Photos</CENTER><br><hr> <br>
      <CENTER><inpu t name='album' type=image
      src='images/vba3626.gif' value='photogal lery/Test Three'
      onClick='albums elect.submit(); '></CENTER>
      <CENTER>Test Three Photos</CENTER><br><hr> <br>
      </form>
      </BODY>
      </HTML>


      Everything works as expected. What are you doing differently? Are you
      attempting to get the value propert? If so, the online docs at msdn state:

      The x-coordinate is submitted under the name of the control with .x
      appended, and the y-coordinate is submitted under the name of the control
      with .y appended. Any value property is ignored.





      --
      Microsoft MVP - ASP/ASP.NET
      Please reply to the newsgroup. This email account is my spam trap so I
      don't check it very often. If you must reply off-line, then remove the
      "NO SPAM"


      Comment

      • McKirahan

        #4
        Re: Request.Form(va r) empty with IE, works fine with Firefox. Help please.

        "Dave" <dave@seafarete ch.co.ukwrote in message
        news:1157118656 .449405.142850@ p79g2000cwp.goo glegroups.com.. .
        Hi,
        >
        I've been trawling the web for answer to my problem with no luck
        although I'm hardly alone it seems!
        >
        Below is the generated source for an ASP page that posts a value called
        'album' to another ASP page. The other page retrieves the value with
        Request.Form('a lbum'); On Firefox this works fine every time. On IE6, I
        always get nothing. I'm pretty sure it's the posting side that is at
        fault, so that's what I've shown here. Oh, I tried Request.QuerySt ring
        too and again, fine on Firefox, nothing on IE6.
        >
        Any help would be much appreciated.
        >
        <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
        <meta http-equiv="Content-Language" content="en-us">
        <title>Galler y</title>
        <!--mstheme-->
        <link rel="stylesheet " type="text/css"
        href="_themes/poetic2/poet1011.css">
        <meta name="Microsoft Theme" content="poetic 2 1011, default">
        </head>
        <body>
        <form name='albumsele ct' action="gallery _intro.asp" method="post"
        target="intro">
        <CENTER><h2>ALB UMS</h2></CENTER><hr><br>
        <CENTER><inpu t name='album' type=image src='photogalle ry/Test
        One/Title.jpg' value='photogal lery/Test One'
        onClick='submit ();'></CENTER>
        <CENTER>Test One Photos</CENTER><br><hr> <br>
        <CENTER><inpu t name='album' type=image src='photogalle ry/Test
        Two/Title.jpg' value='photogal lery/Test Two'
        onClick='submit ();'></CENTER>
        <CENTER>Test Two Photos</CENTER><br><hr> <br>
        <CENTER><inpu t name='album' type=image src='photogalle ry/Test
        Three/Title.jpg' value='photogal lery/Test Three'
        onClick='submit ();'></CENTER>
        <CENTER>Test Three Photos</CENTER><br><hr> <br>
        </form>
        </body>
        </html>
        Strip it down and you have:
        <input name='album' type=image
        three times!

        Which is your
        Request.Form('a lbum');
        supposed to reference?

        Of course, were seeing the generated code not the ASP page...

        Strip the calling and called pages down to the minimum
        then test them; if there's still a problem then post them.


        Comment

        • Dave

          #5
          Re: Request.Form(va r) empty with IE, works fine with Firefox. Help please.

          Hi Ray,

          Thanks for responding. The ASP is below. As another exercise I did a
          view source from both firefox and IE6 to compare them. Whether this is
          merely a difference in the two "view source" implementations I don't
          know but in the Firefox one, the single quotes around 'album' had been
          changed to double quotes ("album") and the strings for img src had been
          'translated', ie the spaces changed to %20.

          eg: Firefox says:

          <center><inpu t name="album" src="photogalle ry/Test%20One/Title.jpg"
          value="photogal lery/Test One" onclick="submit ();"
          type="image"></center>

          but IE6 says:

          <center><inpu t name='album' src='photogalle ry/Test One/Title.jpg'
          value='photogal lery/Test One' onclick=submit( );' type='image'></center>

          Probably a red herring but I thought I'd mention it.

          The ASP code for this is:

          ------------------------------------------------------------------
          <%@ Language=JavaSc ript %>
          <html>

          <head>
          <meta http-equiv="Content-Type" content="text/html;
          charset=windows-1252">
          <meta http-equiv="Content-Language" content="en-us">
          <title>Galler y</title>
          <meta name="Microsoft Theme" content="poetic 2 1011, default">
          </head>

          <body>

          <form name='albumsele ct' action="gallery _intro.asp" method="post"
          target="intro">
          <CENTER><h2>ALB UMS</h2></CENTER><hr><br>

          <SCRIPT LANGUAGE="JavaS cript" RUNAT="Server">

          var fso, f, fc, fs, so, tl;
          var fullpath, fsr;

          fso = new ActiveXObject(" Scripting.FileS ystemObject");

          fullpath = Server.MapPath( "photogallery") ;

          f = fso.GetFolder(f ullpath);
          fc = new Enumerator(f.Su bFolders);

          for (; !fc.atEnd(); fc.moveNext())
          {
          fs = fc.item().Path;
          so = fso.OpenTextFil e(fs + "/Title.txt", 1, 0);
          tl = so.ReadLine();
          so.Close();

          fs = fc.item().Name;
          fsr = "photogalle ry/" + fs.toString();
          Response.Write( "<CENTER><i nput name='album' type=image src='" + fsr +
          "/Title.jpg' value='" + fsr + "' onClick='submit ();'></CENTER>");
          Response.Write( "<CENTER>" + tl + "</CENTER><br><hr> <br>");
          }

          Response.Write( "</form></body></html>");

          </SCRIPT>
          ------------------------------------------------------------------

          I'm now really hoping you look at this and go "Ah Ha!!!".

          As for the submit(): According to my documentation, its required to
          make the form submit when you click the pic. Perhaps it one of those
          optional bits.

          Dave

          Ray Costanzo [MVP] wrote:
          Can you give your ASP code? Also, what's "submit()?" An <input
          type="image"wil l submit the form when clicked already.
          >
          Ray at work
          >

          Comment

          • Dave

            #6
            Re: Request.Form(va r) empty with IE, works fine with Firefox. Help please.

            I've posted the ASP now. I tried it with just one entry instead of
            three. Same problem.

            With Firefox, the Request.Form correctly references the instance of
            'album' that was clicked.

            Thanks for the thought though.

            Dave

            McKirahan wrote:
            Strip it down and you have:
            <input name='album' type=image
            three times!
            >
            Which is your
            Request.Form('a lbum');
            supposed to reference?
            >
            Of course, were seeing the generated code not the ASP page...
            >
            Strip the calling and called pages down to the minimum
            then test them; if there's still a problem then post them.

            Comment

            • Dave Anderson

              #7
              Re: Request.Form(va r) empty with IE, works fine with Firefox. Help please.

              Dave wrote:
              On Firefox this works fine every time. On IE6, I always
              get nothing.
              >
              <input name='album' type=image ...>
              If you simply tried this, you would understand the issue entirely:

              Response.Write( Request.Form)



              In short, INPUT TYPE="image" elements send .x and .y values. According to
              MSDN, VALUE is not a valid property of this element:

              Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

              Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


              This appears to conflict somewhat with the HTML specification:


              If you want to know which image input was clicked, you need unique names,
              and then you can do this:

              JScript:
              if (Request.Form(" input_name.x"). Count) ...

              VBScript:
              If Request.Form("i nput_name.x").C ount 0 Then ...



              --
              Dave Anderson

              Unsolicited commercial email will be read at a cost of $500 per message. Use
              of this email address implies consent to these terms.


              Comment

              • McKirahan

                #8
                Re: Request.Form(va r) empty with IE, works fine with Firefox. Help please.

                "Dave" <dave@seafarete ch.co.ukwrote in message
                news:1157121753 .944053.302660@ 74g2000cwt.goog legroups.com...
                I've posted the ASP now.
                [snip]

                Where?


                Comment

                • Dave Anderson

                  #9
                  Re: Request.Form(va r) empty with IE, works fine with Firefox. Help please.

                  I wrote:
                  According to MSDN, VALUE is not a valid property of this element:
                  >
                  Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

                  Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

                  >
                  This appears to conflict somewhat with the HTML specification:
                  http://www.w3.org/TR/html401/interac...ef-value-INPUT
                  I should add that this behavior (not sending the name-value pair) remains
                  the same under IE7.

                  And to clarify my comment about a conflict with the specification, I think
                  Microsoft and Mozilla interpret the recommendation differently. There is
                  wriggle room, too, since the recommendation does not define image controls
                  as Control Types, which directly refutes the notion that they could be
                  Successful Controls:





                  FWIW, Opera behaves like IE on this matter.



                  --
                  Dave Anderson

                  Unsolicited commercial email will be read at a cost of $500 per message. Use
                  of this email address implies consent to these terms.


                  Comment

                  • Dave

                    #10
                    Re: Request.Form(va r) empty with IE, works fine with Firefox. Help please.

                    Mr Anderson, you're a star. Many many thanks.

                    Dave

                    Dave Anderson wrote:
                    I wrote:
                    According to MSDN, VALUE is not a valid property of this element:

                    Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

                    Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


                    This appears to conflict somewhat with the HTML specification:
                    http://www.w3.org/TR/html401/interac...ef-value-INPUT
                    >
                    I should add that this behavior (not sending the name-value pair) remains
                    the same under IE7.
                    >
                    And to clarify my comment about a conflict with the specification, I think
                    Microsoft and Mozilla interpret the recommendation differently. There is
                    wriggle room, too, since the recommendation does not define image controls
                    as Control Types, which directly refutes the notion that they could be
                    Successful Controls:
                    >


                    >
                    >
                    FWIW, Opera behaves like IE on this matter.
                    >
                    >
                    >
                    --
                    Dave Anderson
                    >
                    Unsolicited commercial email will be read at a cost of $500 per message. Use
                    of this email address implies consent to these terms.

                    Comment

                    Working...