If we are using the previous script then the AJAX works→
https://www.diffchecker.com/45LsgGRd
LHS is previous one.
If we are using the previous script then the AJAX works→
https://www.diffchecker.com/45LsgGRd
LHS is previous one.
When I press the “Review and Confirm” button on the page at https://blackuranium.com/app/temp/1/ I get the following console error message:
(index):8343 Uncaught TypeError: $(...).validate is not a function
at HTMLButtonElement.<anonymous> ((index):8343)
at HTMLButtonElement.dispatch (script.js?ver=1.0.0:1431)
at HTMLButtonElement.a (script.js?ver=1.0.0:1355)
Is this consistent with what you are experiencing @codeispoetry ?
Because if you are not experiencing that, we don’t need to waste time investigating that, and should instead focus on experiencing the same issue that you are having.
Once we confirm that we are on the same page, and experiencing the same problem, that is when benefit is gained from investigating the cause of the problem.
Yes, Thats right. Please give me 5 more minutes I am creating a fresh installation to give another picture. I will be back shortly.
Sir,
In order to avoid loss of efforts. Let me summarize.
It all started from here → The HTML Form.
It has validations working, but later I converted them into a WP shortcode inside a plugin that I created.
I have done a new installation Wordpress here now to make things clear.
In the new installation, the AJAX part of the form submission working fine and emails are sending in association with WP mail function.
But Validations are not working. That means even the blank form is getting submitted.
If in this form(Wordpress installation) validations work then problem solved. validations were written in script.js
If in this version if the validations starts to work - Issue at hand may be solved.
Now coming back to the old WP installations where we were discussing that validations are working, but AJAX part is not working.
When validations were not working I was looking for a solution all over the Google and I stumbled upon that Git Hub link. When I adjusted my code in accordance with that GitHub link the validations were working that were actually written in the script.js file but AJAX part was not working.
These validations are not coming from the adjusted code nor they are the part of the adjusted code that I did change after taking a clue from GITHUB link.
If we are using the previous script then the AJAX works→
https://www.diffchecker.com/45LsgGRd
LHS is previous one.(Now installed on → https://blackuranium.com/app/temp/2/)
Validations were being done using a jQuery validate plugin.
When that validate plugin is installed and working, it should be visible in $.fn
as method called validate. That method is not currently visible on your page.
That would explain why the validation is not working, because the validation library is not installed.
Sir, thank you for enlightening me.
But the library was also not included in the Pure HTML version How come validations are working there, but now lets come to two WP Version.
https://blackuranium.com/app/temp/1/
https://blackuranium.com/app/temp/2/
In #2 AJAX is working, but no validations and
in #1 validations is working but no AJAX (This is a slight variation of the code in the <script
> tag as compared to #2 WP installation, and in both, I haven’t included the library separately). this is is variation as in code suggested at GITHUB link.
where should I start troubleshooting? the best will be if #2 WP installation should have validations as AJAX is in action there.
#1 generates the error Paul listed above. So no, validations is not working.
#2 has removed the validation, so yes, it works.
the Pure HTML version fails because its invoking a function on an undefined variable in its button. It also isn’t using jquery, so it doesnt attempt to invoke a validate() function.
because of the above. the ‘pure HTML’ (Vanilla Javascript) version isnt trying to invoke a jQuery addon.
You should start troubleshooting by going back to the article you linked in your OP, and actually following Step 2 instead of skipping it.
I didnt get this part?
In #2 WP installation why the validations are not working that were working in Pure HTML?
script.js
is present there also?
My entire focus will be that validations that are working in Pure HTML format should work in WP installation #2 because same script.js is present there also.
It’s in the article that you linked to in post #1
at no point in this thread have you said you are trying to implement a non-jquery method of validation. Your OP is using the jQuery validation plugin, the article you linked to in the OP is using the jQuery validation plugin. So I told you to go back to the article, and actually load the jQuery validation plugin that you keep asking about.
your #2 page has bound the submit event to the script in question. I’m not going to crawl through 9000 lines of minified JS to try and identify why it’s failing, and chalk it up to WP being crappy at importing scripts not specifically designed for WP.
2 posts were split to a new topic: Problem with form inputs
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.