Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Contact Us Page Loads at BOTTOM of screen… Not Top
 
brianb421
Sr. Member
 
Total Posts:  196
Joined:  2009-04-23
 

We’ve added text to the top of our contact us page
and it’s causing it to sometimes load the page at the bottom of the screen (well… usually always)

it loads where the cursor shows up in the Contact Us form (which is at the bottom of the page).

I’m on a Macbook / snow leopard 10.6.2.
I’ve tested this on Firefox / Safari / Chrome.
All load the page NOT at the top of the page.

How do I get this page to load normally?

Here is the code i’ve used:

<div style="float:left; padding-right:15px; padding-bottom:5px;"><img src="images/contact/girl.jpg" width="225" height="337" /></div>

<
p><img src="images/titles/contact.jpg" width="203" height="50" /></p>

 <
p>A bunch of contact info text.</p>

<
form id="contactForm"  method="post" action="http://www.example.com/cart/contacts/index/post/">
  <
fieldset class="group-select">

        <
h4 class="legend">Contact Information</h4>
  <
ul>
    <
li>
      <
div class="input-box">
                    <
label for="name">Name <span class="required">*</span></label><br />
        <
input name="name" id="name" title="Name" value="" class="required-entry input-text" type="text" />
      </
div>

                <
div class="input-box">
                    <
label for="email">Email <span class="required">*</span></label><br />
                  <
input name="email" id="email" title="Email" value="" class="required-entry input-text validate-email" type="text" />
      </
div>

                <
div class="clear"></div>

                <
div class="input-box">

                    <
label for="telephone">Telephone <span class="required">*</span></label><br />
                  <
input name="telephone" id="telephone" title="Telephone" value="" class="required-entry input-text" type="text" />
      </
div>

                <
div class="clear"></div>

                <
div class="input-box">
                    <
label for="comment">Comment</label><br />
                  <
textarea name="comment" id="comment" title="Comment" class="required-entry input-text" style="height:150px;width:100%;" cols="50" rows="5"></textarea>

                </
div>
    </
li>
  </
ul>
  </
fieldset>
    <
div class="button-set">
      <
div  style="float:left" class="required">* Required Fields</div>
      <
button class="form-button" type="submit"><span>Submit</span></button>
    </
div>

</
form>
<
script type="text/javascript">
    var 
contactForm = new VarienForm('contactForm'true);
</script>&nbsp;
 
Magento Community Magento Community
Magento Community
Magento Community
 
XenonSupply
Jr. Member
 
Total Posts:  26
Joined:  2011-06-28
 

I also seem to be having this issue but with my “my accounts” page

did you find a solution to this since posting this?

Thanks,
-Phil

 
Magento Community Magento Community
Magento Community
Magento Community
 
XenonSupply
Jr. Member
 
Total Posts:  26
Joined:  2011-06-28
 

For anyone that has this issue with any magento form/page, you need to make sure the script comes first, before the webform.

i.e.

<script type=\\\"text/javascript\\\">
var contactForm = new VarienForm(\\\’contactForm\\\’, true);
</script>;

the example has this at the bottom, and needs to be loaded at the top before the <form>, sometimes also before the first <div>.  This is

That should do the trick, worked for both my contact us page, as well as the my account page.

Hope this helps some people out, i wasted all day wondering what was wrong.

-Phil

 
Magento Community Magento Community
Magento Community
Magento Community
 
XenonSupply
Jr. Member
 
Total Posts:  26
Joined:  2011-06-28
 

For anyone that has this issue with any magento form/page, you need to make sure the script comes first, before the webform.

i.e.

<script type=\\\"text/javascript\\\">
var contactForm = new VarienForm(\\\’contactForm\\\’, true);
</script>;

the example has this at the bottom, and needs to be loaded at the top before the <form>, sometimes also before the first <div>.  This is

That should do the trick, worked for both my contact us page, as well as the my account page.

Hope this helps some people out, i wasted all day wondering what was wrong.

-Phil

 
Magento Community Magento Community
Magento Community
Magento Community
 
XenonSupply
Jr. Member
 
Total Posts:  26
Joined:  2011-06-28
 

For anyone that has this issue with any magento form/page, you need to make sure the script comes first, before the webform.

i.e.

<script type=\\\"text/javascript\\\">
var contactForm = new VarienForm(\\\’contactForm\\\’, true);
</script>;

the example has this at the bottom, and needs to be loaded at the top before the <form>, sometimes also before the first <div>.  This is

That should do the trick, worked for both my contact us page, as well as the my account page.

Hope this helps some people out, i wasted all day wondering what was wrong.

-Phil

 
Magento Community Magento Community
Magento Community
Magento Community
 
brianb421
Sr. Member
 
Total Posts:  196
Joined:  2009-04-23
 

Thanks for that insight. I couldn’t get the above solution to work, but I found another solution.

Here is how to add a contact form to the bottom of a CMS Page without having the cursor being automatically inserted into the contact form, thus pulling/scrolling the entire page down to the bottom where the form is.

1. Create a static CMS page (TURN OFF the WYSIWYG editor).

2. Type in all your text.

3. Then, at the bottom of the page, to pull in the contact form, enter this code:

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}

4. Open the form file:
app/design/frontend/default/default/template/contacts/form.phtml

Find the script at the way bottom and change true to false.

Find this:

<script type="text/javascript">
//<![CDATA[
    var contactForm = new VarienForm('contactForm', true);
//]]>
</script>

Change the true to false, like this:

<script type="text/javascript">
//<![CDATA[
    var contactForm = new VarienForm('contactForm', false);
//]]>
</script>

Upload, clear Magento cache, browser cache, recompile if you moved files around, etc, etc. 

Viola!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top