How to make the confirm page scroll...

User 39859 Photo


Registered User
62 posts

I have a form that is long, and the iframe is even longer to accommodate all of the error messages that could be generated.

However, I need to generate a confirmation message that MUST be viewed by the person who completes the form.

I have chosen the option of "Redirect to custom HTML page" for the confirmation message since I have to use information that was entered to piece together the message (otherwise I would just redirect to a new page).

My issue is that the message forms at the top of the iframe, but once the form is submitted the viewer is left near the bottom of the iframe, and unless they become curious and scroll up they don't know a message has been created.

I've messed around with trying to generate the message at different positions down the page, like trying to make the message appear at the bottom of the page with enough <br> tags, but no matter what I do it doesn't work in all situations.

What I REALLY need is to be able to force the document in the iframe to scroll to the top.

HELP!

Thanks
User 187934 Photo


Senior Advisor
20,193 posts

If you redirect to a custom html page then the form should break out of the iframe and open in the parent window. How did you enter your link?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 39859 Photo


Registered User
62 posts

I used this option: Redirect to custom html page.

The message displays just fine, it's just that the screen stays at the bottom of the frame and you never see it.

I can't put a public link to this yet as my customer is still testing and the site hasn't been approved. Is there a way I could send you a link privately so that you can see what I am trying to do?
User 187934 Photo


Senior Advisor
20,193 posts

Did you use http://mydomain.com/custompage.html?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 122279 Photo


Senior Advisor
14,461 posts
Online Now

Eric, you are able to hack into most things. Is there a way to add to the redirect code target="_top"?

I haven't got time to test this, as I have to climb up and shovel half a metre of snow from my roof... :/
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 187934 Photo


Senior Advisor
20,193 posts

That's why I asked about the redirect structure of the link. :)
I've done this for a bunch of my forms. Near the top of the myformname.html you look for the

method="post" action="../myformname.php"

Add either target="_top" or target="_parent" to the line of code

method="post" action="../myformname.php" target="_top"
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 38401 Photo


Senior Advisor
10,951 posts

Also if you create your own "Thank you for contacting us (or filling out our form or whatever way you want to word it)....." page and redirect it, it's always at the top of the page then. No need to alter the code that way at all. What I do is remove the results tag from the results emails's html when I take out their little section on how to edit it. This way the results don't show up either (which I think is a bit redundant since they will get that in an email too. To me that's the easiest setup for it, make it a page to land on :)
User 187934 Photo


Senior Advisor
20,193 posts

That's what I thought she had done. If you select custom html page redirect it should breakout of the iframe and reload the entire page to top or parent. I think she did something else or typed a relative link in for the redirect.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 38401 Photo


Senior Advisor
10,951 posts

A relative link should still work as long as you link to a separate page.
User 39859 Photo


Registered User
62 posts

Thanks for the replies; but, the problem is that I NEED the form results. I know it's redundant, but, that's what my customer wants.

So, I am wanting to display a message similar to what is sent out in the email to the person who fills out the form. They want a confirmation that the form was completed successfully, and then I use some of the data from the form fields to create the message, and I also alert them to the fact that there will be an email.

So, I have to use either the "Redirect to custom HTML page," or "Confirmation Message" methods to create the confirm message. In both cases the message appears in the iframe, at the top of the frame, and unless the viewer of the form scrolls up they will never see the message.

I've tried placing enough <br> tags, or using a transparent image to force the message closer to the bottom, but, since the scroll bar stays at the position it was in when the form was submitted, then a message near the bottom of the frame could be missed as well.

I was trying to use the "Redirect to custom HTML page" option because I have read that adding something like "onload="location.href='#top'">" to the <body> tag, or giving a specific location (like 0,0) would force the page to the top of the frame, but, that isn't working for me.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.