Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript “Contact Us” Div ( Hidden ) shows and hides on page refreshes

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #31749
    fjorko
    Member

    Hi All

    Very new to Web dev and Jquery in general – in fact I’m a dev noob. I’m Building my first site for experience, and I dearly would love your help with my site. Basically – each time the site loads in IE7/8 my contact us form which is hidden behind my main content opens briefly and closes as soon as the jquery code starts executing that hides this form via a .css() method. It occasionally happens in FF and Chrome as well. I think that jquery is not quick enough to set the css property of the contact us div to 0px in order to hide the form from view before the user sees it.

    Please check this with IE and see if you can spot the reason with Firebug please…. any advice is greatly appreciated…

    Thank you.

    PS. Be kind – it’s my first attempt at this, and I’m not finished yet….. :-)

    Link: http://test.epbudgerigars.com

    #58731
    Johnnyb
    Member

    Hey there, nice job for a beginner! The problem is that you’re not giving the contact_wrap a height in the css, so it shows the content and then the jquery uses the ‘$(“#contact_wrap”).css(“height”,”0px”);’ to hide it. Try setting the #content_wrap properties to ‘height: 0; overflow: hidden’, initially in the CSS file, and then when you click the ‘Contact Us’ button use $(“#contact_wrap”).animate({height: ‘400px’}, 500); which will expand it to whichever height you like.

    #58725
    fjorko
    Member

    Johnny – you’ve just become my new best friend. I think it works !

    Can you verify that you do not get the brief “form exposure” anymore ? Can you check from your end on IE, FF and Chrome pls ?

    Thanks so much !

    #58651
    fjorko
    Member

    How will I validate the form then ? It uses Javascript for that too… so even if I had a separate contact page for non-java users, the form will be “broken” in terms of validation…

    I understand your argument though..

    #58631
    TT_Mark
    Member

    Please don’t call it ‘java’, because it isn’t.

    Validation wise, you should never rely on just JavaScript validation, because if JavaScript is disabled (as any spambot browsing your site will be) then they will bypass your validation and you’ll receive loads of spam. Server-side validation is also key, so do some research into PHP validation

    #58590
    fjorko
    Member

    So is it either javascript or php validation ? Which is best ? I assume PHP from the two options ?

    I meant Javascript on my previous post, i know there is a difference…

    EDIT: Was just thinking – my javascript is doing an AJAX post to a PHP file anyway…if javascript is disabled on the client side – will something like a spambot still be able to spam me without being able to submit to the PHP file that does the actual sending of email…. sorry if i’m being naive – just very new to this as I said before, but really willing to learn the proper way of doing things . . .

    #58570
    TT_Mark
    Member

    PHP is best, but there is no harm doing both. Relying solely on JavaScript validation is leaving you open to hackers and spambots

    #58554
    fjorko
    Member

    Thanks…now to figure out how to change my form to incorporate both and still validate without a page refresh…

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.