1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Populate Data in email response form

Discussion in 'JavaScript' started by rbwallis, Aug 28, 2018.

  1. #1
    Hi all, I'm new so be gentle. ;)

    I have seen some rental sites where, the info about a property is shown. When a client clicks on a "contact" button, a form pops up to send an email to the property owner that they are interested. This email includes the property address from the listing. How can I get this to happen?
    EXAMPLE:
    Landlord enters property details in a form.
    Form is saved and displayed on the site, with a "Contact" button.
    Client clicks on "Contact" button, which opens a form with the address and the landlord's email pre-populated.
     
    rbwallis, Aug 28, 2018 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #2
    Are you coding your own website?
    Are you using any front-end libraries?
    The how is relatively simple, but it will differ from site to site.
     
    sarahk, Aug 28, 2018 IP
  3. rbwallis

    rbwallis Member

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    Thanks for responding. Yes, I am coding my own site. I don't believe I am using front-end libraries.
     
    rbwallis, Aug 28, 2018 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #4
    Look up "modal popup" or "lightbox" for a way to have the contact form displayed.

    The form itself is no different to any other contact form - it's just hidden initially and only displayed when the user clicks your contact button. It'll be a combination of html, css and javascript.
     
    sarahk, Aug 28, 2018 IP
  5. rbwallis

    rbwallis Member

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    Thanks for the info. It's not the form I'm having trouble with. I want to send an email with the property address and the landlord's email populated (from landlord's previously entered data).
     
    rbwallis, Aug 29, 2018 IP
  6. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #6
    Is the landlord the person visiting the page, or the person whose property is being displayed
    Either way, you should have that when you generate the page.

    Let's say I'm looking at a rental and want to apply for it.
    I click contact and that calls /contact?property=123
    and the form that pops up has the info for property #123
     
    sarahk, Aug 29, 2018 IP
  7. rbwallis

    rbwallis Member

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #7
    I see where you're coming from, like a page with the property information. Here is a screenshot after the landlord enters property information:
    upload_2018-8-29_20-17-31.png
    When the contact button is clicked, I want to simply send an email with the property address and the prospective tenant's email sent to the landlord.
     
    rbwallis, Aug 29, 2018 IP
  8. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #8
    Right! so when you build the page you already know all that about the landlord. At it's simplest you can just have
    <a href="mailto:blah@blah.com?subject=1234%20Any%20St">Contact</a>
    Code (markup):
    There will be a url encode command in the language you're using so just build the string and get it to add all the %20 stuff.

    You can get fancier with proper modal forms, and ajax to make it more professional - including not exposing the landlord's email to every scraper that visits your site.
     
    sarahk, Aug 29, 2018 IP
  9. rbwallis

    rbwallis Member

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #9
    I get where you're coming from. I'm having trouble with where the code goes. The contact email field is called "contact" and I want it to pull into the outgoing email.
     
    rbwallis, Sep 21, 2018 IP