Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8337131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:12:23+00:00 2026-06-09T04:12:23+00:00

I’m using superfish menu for my site (which is using Silverstripe), see superfish menu

  • 0

I’m using superfish menu for my site (which is using Silverstripe), see superfish menu example here.

The site is all working fine but the contact page, it seems everytime I put $contactUsForm in, the contact page would try to load the contact form first, the down arrows in the superfish menu disappear for a few seconds and the menu moves towards the left. Then the arrows appear and the menu moves to the normal positions again after the form is loaded.

Every other page is fine. Can anyone give me some hints why this is happening and how can I fix it? Thanks.

Here is my ContactPage.php I can add more code here if needed.

static $db = array(

    "Phone"     => "Varchar",

    "Email"     => "Varchar",

    "Address"   => "Text",

    "Thanks"    => "Text",

    "Long"      => "Int",

    "Lat"       => "Int",

    //added for google map 04012012

     "EmbedCode" => "HTMLText" 

);



static $has_one = array(

);



function getCMSFields() {

    $fields = parent::getCMSFields();



    $fields->addFieldToTab('Root.Content.ContactDetails', new TextField('Phone'));

    $fields->addFieldToTab('Root.Content.ContactDetails', new TextField('Email'));

    $fields->addFieldToTab('Root.Content.ContactDetails', new TextareaField('Address','Address',8,3));

    $fields->addFieldToTab('Root.Content.ContactDetails', new TextareaField('Thanks','Thank You Message',8,3));     

    #$fields->addFieldToTab('Root.Content.Main', new TextField('Long'));

    #$fields->addFieldToTab('Root.Content.Main', new TextField('Lat'));

    //added for google map 04012012

     $fields->addFieldToTab('Root.Content.ContactDetails', new TextareaField('EmbedCode', 'Embed Code')); 





    return $fields;

     }

     function HasSentContact() {

        return (isset( $_GET['sent'] ) ) ? true : false;

     }

   function onBeforeWrite() {

$this->EmbedCode = str_replace("></iframe>", "> </iframe>", $this->EmbedCode);

 parent::onBeforeWrite();

}

}


 class ContactPage_Controller extends Page_Controller {


public function init() {

    parent::init();

    Requirements::themedCSS('Contact'); 

}



function contactUsForm() {

            $recaptchaField = new RecaptchaField('MyCaptcha');
    $recaptchaField->jsOptions = array('theme' => 'white'); // optional it changes the look added 07122011


    // Create fields

    $fields = new FieldSet(

    new TextField('Name'),

    new TextField('Surname'),

    new TextField('Email', 'Email Address'),

    new TextField('Phone', 'Phone Number'),

    new TextareaField('Message', 'Enquiry'),

    new LabelField('MyCaptcha', 'Please enter the characters below'),
    $recaptchaField

    //new PhpCaptchaField(),

    //new HeaderField ("Please Enter What You See Here, it's not case sensitive", "6")

    );



    // Create actions

    $actions = new FieldSet(

    new FormAction('doContactUs', 'Submit')

    );



    //valididate fields

    $validator = new RequiredFields('Name', 'Email', 'Message');



    return new Form($this, 'contactUsForm', $fields, $actions, $validator);



}


function doContactUs($data, $form) {



    $from = $data['Email'];

    $to = $this->Email;

    $subject = 'Contact Us Form';

    $body = $data['Name'].' '.$data['Surname'].'\n'.$data['Email'].'\n'.$data['Phone'].'\n\n'.$data['Message'];


    $email = new Email($from, $to, $subject, $body);

    $email->sendPlain();

    //Director::redirectBack();

    Director::redirect($this->Link().'?sent=1');

}

}
?>

ContactPage.ss:

    <div id="intro">

                    <h1 id="h1_home">$Title</h1>

<% if HasSentContact %>
    <div id="Form">
    <h2>$Thanks</h2>
    </div>
<% else %>
    $Content
    <div id="Form">
    $contactUsForm
    </div>    
<% end_if %>

    <div id="Details">
        <h3>GOOGLE MAP</h3>
        <!--added 05012011, added divs-->
        <div id="googlemap">    {$EmbedCode} </div>

        <div id="contactinfo">
        <h3>Contact Info</h3>
        <table class="alignRight">
            <tr>
                <td class="width200 alignLeft">Phone</td>
                <td>{$Phone}</td>
            </tr>
            <tr>
                <td class="alignLeft">Email</td>
                <td><a href="mailto:{$Email}">{$Email}</a></td>
            </tr>
            <tr>
                <td class="alignLeft">Address</td>
                <td>{$Address}</td>
            </tr>
        </table>
        </div><!-- contactinfo -->
    </div><!--Details-->


     $Form 
     </div><!--intro-->
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:12:24+00:00Added an answer on June 9, 2026 at 4:12 am

    Sounds like a JavaScript conflict problem. SilverStripe 2.4 includes some Prototype JS, along with some jQuery, to render forms on the front end. They don’t play nicely together.

    Try wrapping your Superfish JS (your code, not the file you downloaded from their website) in a closure like so:

    (function($) {
        $(document).ready(function(){
            // your code here.
        })
    })(jQuery);
    

    Read more at the SS docs – http://doc.silverstripe.org/framework/en/topics/javascript/

    Another tip – use a JS debugger. In Chrome comes bundled with great dev tools, and FireFox has the FireBug plugin. Use the JS console in either to see if there are any JavaScript errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.