Reputation: 31
I have a form and I am using JavaScript to validate the form, so if we leave a field blank it will alert "Please Enter your Name".
If I go to the link directly, it works perfectly. But I am using an iFrame to embed it into other sites. When I embed it, and click Submit with an empty field it says:
The page at http://www.domain.com says: Please Enter your name
Upvotes: 2
Views: 6352
Reputation: 944192
This is a security measure to prevent a framed site from displaying a message that appears to come from the parent site.
You cannot avoid it without avoiding the use of alert()
.
You could display the information to the user by modifying the DOM to display it as part of the page instead.
Upvotes: 5