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.
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.
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.
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).
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
I see where you're coming from, like a page with the property information. Here is a screenshot after the landlord enters property information: 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.
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.
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.