Reputation: 337
I am using a hosting platform that does not use PHP, and changing is not an option. Is there any way I can hide an email address from my contact form when read in plain HTML?
The email address is held within an input tag, and I want it to be obscured when the plain HTML is read, but when the submit button is clicked the email address appears as normal/sends the email to the correct address.
<input type="hidden" name="cc_emails[]" value="[email protected]" />
<button type="submit">Send</button>
I am trying to do this to eliminate spam and bots being able to pick addresses up from plain HTML files.
Thanks!
Upvotes: 0
Views: 2119
Reputation: 36
First, create a js file and link it to the current HTML file. Give id attribute to the input field, id="email" And write the following in js file:
document.getElementById("email").value = "[email protected]"
This will not show your email address in the HTML file. And will set the value too.
Upvotes: 1