contact form

Discussion in 'HTML & Website Design' started by keerti, Jul 31, 2012.

  1. #1
    How can make a quick contact form which open on the click of button and get submit without refreshing the page .
    Smooth contact form

    http://satyamexports.in/granite/abslute_black_granite.html

    i can make request quote link on the image and a small form gets open ..
    can any one help me

    thanks
     
    keerti, Jul 31, 2012 IP
  2. flotwig

    flotwig Peon

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    2
    Trophy Points:
    0
    #2
    Use jQuery to POST the data and to transition an initally invisible <div> into viewing once the user clicks a link.
     
    flotwig, Jul 31, 2012 IP
  3. wyeoh

    wyeoh Greenhorn

    Messages:
    31
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    8
    #3
    You need to use jquery/ajax for this. Try and google ajax contact form or jquery contact form.
    Instead of posting to a new page, you post using jquery to another page and fetch the result back.

    Check http://api.jquery.com/jQuery.post/ for the api and example.
     
    wyeoh, Jul 31, 2012 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    You don't "need" jquery, (you never "need" jquery, that fat bloated steaming pile being... ok, broken record, I'll stop there...) but as mentioned, AJAX is how you go about it; that or put the form into a iframe and/or object. (the latter being what you SHOULD use since this isn't 1998).

    I actually prefer the latter method because it also works for people browsing with scripting turned off... If you DO go the ajax route, make sure that people who don't have scripting available or intentionally block it (the millions and millions who download plugins like noScript for example) can still submit that form normally.

    Really though, an OBJECT or IFRAME tag embedding the form into the page as a separate file is a far, far simpler and reliable technique, without hordes of pointlessly complex and convoluted javascript taking something simple and turning it into a slow loading bloated train wreck.

    ... and remember, 90% of the time some {expletive omitted} says "use jquery", you probably shouldn't.
     
    deathshadow, Jul 31, 2012 IP