- This topic has 1 reply, 2 voices, and was last updated 3 years, 10 months ago by
Tom.
-
AuthorPosts
-
April 13, 2017 at 12:51 pm #305586
Hans
I want to address a form on a page. Everything is up and running except the validation. I send you few remarks which are strange for me:
1. Head – section
<meta name="generator" content="WordPress 4.7.3" /> <link rel="canonical" href="http://huppenbroich.de/ris/einstellung-bekanntgeben/" /> <link rel='shortlink' href='http://huppenbroich.de/ris/?p=537' /> <link rel="alternate" type="application/json+oembed" href="http://huppenbroich.de/ris/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fhuppenbroich.de%2Fris%2Feinstellung-bekanntgeben%2F" /> <link rel="alternate" type="text/xml+oembed" href="http://huppenbroich.de/ris/wp-json/oembed/1.0/embed?url=http%3A%2F%2Fhuppenbroich.de%2Fris%2Feinstellung-bekanntgeben%2F&format=xml" /> <script scr=http://huppenbroich.de/ris/wp-content/themes/generatepress_child/datum.js>
The coging of two links is very strange. What may be the reason?
I added the script unsing hook wp_head.2. In Firefox’s browser console I found the following message:
ReferenceError: form_validation is not defined
In the page with the form is as follows:
<script src="http://huppenbroich.de/ris/wp-content/themes/generatepress-child/datum.js"></script> <!-- [wpforms id="533"] --> <p> <div class="wpforms-container wpforms-container-full" id="wpforms-533"> <form method="post" enctype="multipart/form-data" id="wpforms-form-533" onsubmit="return form_validation()" action="../sende-details.php" class="wpforms-validate wpforms-form" data-formid="533">
And this is the schript:
`
<script type=”text/javascript”>
function form_validation() {
var arr = document.forms[‘sende-details’][‘Datum’].value.split(‘.’);
if (arr[0] <= 31 && arr[1] <= 12 && arr[2] >= 2017) {
alert(‘Alles klar!’);
} else {
alert(‘Datum ungültig!’);
}
}
</script>Where is the error????
Appreciate any help!
GeneratePress 1.3.46GP Premium 1.2.96April 13, 2017 at 2:02 pm #305619Tom
Lead DeveloperLead DeveloperHmm, hard for me to tell as I don’t have any knowledge of the form plugin.
Have you checked with their developers? It might be a common problem.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.