Solved

HTML form forces users to download the response.

Posted on 2003-11-12
14
314 Views
Last Modified: 2010-04-09
Here is a weird problem I have been having...

I have a form that posts to an asp page like this:

This form is on the content.html page and posts to the results frame

<form action='http://www.somdomain.com/aspen/page.asp' target='results' method='POST' name='command'>
            cmd<input type='text' name='command'>
            ses<input type='text' name='session_id'>
            ver<input type='text' name='version' value='2.0'>
            <br />
            aic<input type='text' name='aicc_data' size="100">
      </form>

I am using a frame set that is setup like this:

<frameset frameborder="0" border="0" framespacing="0" rows="*,1" onLoad="opener.close();">  
  <frame src="content.html" name="content" frameborder="0">
  <frame src="results.htm" name="results" scrolling="0" frameborder="0">
  <noframes>
   ...
  </noframes>
</frameset>

All the target is doing is preventing my original frame from redirecting to the asp page.  This works fine for some computers but others try to download the response from the asp page as a text file ('page.asp').  Does anyone have any ideas about this problem?
0
Comment
Question by:GreatGatsby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +3
14 Comments
 
LVL 31

Expert Comment

by:seanpowell
ID: 9733741
If you change content.html to content.asp, what happens?
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9733758
Also, I believe the target should be set in the frameset, as opposed to the form tag:

<frame src="content.html" name="content" frameborder="0" target="results">

<form action='http://www.somdomain.com/aspen/page.asp' method='POST' name='command'>
0
 

Author Comment

by:GreatGatsby
ID: 9733991
By setting the frame target to my other frame It would only replace my content frame with the information I wanted in the results frame.  The whole idea behind the results frame is that I don't want my content frame to be redirected on a post.  I can't use a .asp page for my content frame becuase it cannont be regenerated each time.  It is running a Flash movie that is communicating with the browsers javacript to get information from the page.asp page that the form submits to.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 31

Expert Comment

by:seanpowell
ID: 9734013
>>I don't want my content frame to be redirected on a post.
So what should happen to content.html after hitting the submit button?
0
 

Author Comment

by:GreatGatsby
ID: 9734042
The content.html frame should remain the same.  I am having to fix someone else's code so the forced download does not occur.  The hard thing about this is that it only happens on some computers  not all.  I have tried looking at the browser settings and everything on the computer and cannot find a good reason for this to be happening.  What would cause a browser to download the response to a form rather than to just post it to the correct frame?
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 9734076
longshot ... your form is named "command" and one of your inputs is also named "command"
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9734084
The only thing I can think of is if the browser's settings are not setup to handle the asp extension - but that would be unlikely...
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9734089
The input appears to be cmd - not command...
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9734092
Oh, I see what you mean...
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9737790
The target attribute should be in the form tag and should use the name of one of the frames.

The form has to submit *to* something, and when it does, the user's browser attempts to load the file in the form's action attribute.

> The only thing I can think of is if the browser's settings are not setup to handle the asp extension - but that would be unlikely...

The browser normally acts according to the content-type header that's sent with the content. What's happening is that the form handler page is sending some content-type other than "text/html". When the form submitted, what filetype/extension shows in the browser's "Save As..." dialogue?

A link or some form handler code would be helpful.
0
 
LVL 5

Expert Comment

by:prohacx
ID: 9738560
Have you tried

<form action='http://www.somdomain.com/aspen/page.asp' target='results' method='POST' name='command' enctype='text/html'>

Also, make sure you do not have a form named "command" and an input field named "command" (simply do not name your form can be a solution too...)

Good luck!
0
 
LVL 3

Assisted Solution

by:Neil Thompson
Neil Thompson earned 250 total points
ID: 9742469
I had this problem a while ago with a wap site

the solution was solved simply by adding <html>  and </html> openers and closers in the page, as I didn't have them before the asp code tried to push a download

worth a look

Neil
0
 
LVL 11

Accepted Solution

by:
Zontar earned 250 total points
ID: 9742815
> the solution was solved simply by adding <html>  and </html> openers and closers in the page, as I didn't have them before the asp code tried to push a download

This might well explain the problem.

Another solution might be to add

Response.ContentType = "text/html"

to the page before any content is sent to the client.
0
 

Author Comment

by:GreatGatsby
ID: 9752205
You guys both gave correct answers.  I didn't generate the asp page, so when I was digging through the code I discovered the the ContentType was set to "text/plain" we changed it to "text/html" and no more problems!  Thank you so much!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question