Hi all,
I use google maps with a search field. In CF5 I use a little code to prevent the form submitting itself when searching the map:
Any suggestions?
Regards
Bob
I use google maps with a search field. In CF5 I use a little code to prevent the form submitting itself when searching the map:
jQuery(document).on("keypress", ":input:not(textarea)", function(event) {This little code does not seem to work in CF6.
if (event.keyCode == 13) {
event.preventDefault();
}
});
Any suggestions?
Regards
Bob
you used it in a JavaScript view ? if yes then what settings did you use ?
Hi Max,
yes it was in a Load JS action as part of the Google maps code. I was able to migrate the maps code into CF6 but this particular bit does not work.
Regards
Bob
yes it was in a Load JS action as part of the Google maps code. I was able to migrate the maps code into CF6 but this particular bit does not work.
Regards
Bob
Do you have the "Include in document ready" setting enabled ?
Max,
The whole code is put in a Custom Code Action between <script></script> tags. It may be a bit creative but good enough to make Google Maps work.
The whole code is put in a Custom Code Action between <script></script> tags. It may be a bit creative but good enough to make Google Maps work.
I'm not sure if you have fixed this or not, but adding events for the form elements should be inside a document ready event function, you can have a different action for the GMaps code!
This topic is locked and no more replies can be posted.