Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 9 replies, 2 voices, and was last updated 7 years, 6 months ago by
Steven Zahm.
-
AuthorPosts
-
02/15/2019 at 6:46 am #484719
Janet Barlagen
ParticipantHi Steven,
The status of my last question is solved, so I created a new topic.
I edited the plugin, trying your suggestion with the pattern on the zipcode-field.
But there was no errormessage, because field stays empty if autocomplete is not selected :-)Adding ‘required’ did the trick.
Immediatly after the adjustment I get a visitor who tells me it still can go wrong.
If you type anything (the name of a city f.i.), so without selecting a autocomplete and then press Enter instead of the Search button, the form is always submitted.Used all kinds of javascript to prevent pressing Enter in id=”cnmcs-address-input”, name=”cn-zipcode”.
None seems to work.You can type anything you want, no matter the pattern, and then press enter.
Do you have a suggestion what I can do about this?
Greetzz, Janet
02/15/2019 at 9:26 am #484727Steven Zahm
Keymaster****@ Janet**
Well, I know you will need the pattern and the required attribute.
You also have to update the javascript to include form validation. Something like what is discussed in the SO answer as basic but should be enough:
https://stackoverflow.com/a/17865293/5351316
Off the top of my head, maybe this would work:
$('#cn-cat-select').submit(function() { if ( $.trim($("#cnmcs-address-input").val()) === "" ) { alert('You did not fill out the postcode field.'); return false; } });Hope this helps!
02/15/2019 at 9:52 am #484729Janet Barlagen
ParticipantHi Steven,
But I think everything is ingmored if you press Enter instead of Submit.
Why is that?Hope you can help me.
02/15/2019 at 11:14 am #484736Steven Zahm
Keymaster@ Janet
RE: But I think everything is ingmored if you press Enter instead of Submit.
Why is that?The javascript should prevent even the entry key as the form can not be submitted unless the if statements becomes true.
If you find that is not the case, then perhaps adding prevent default will help???
$('#cn-cat-select').submit(function(event) { event.preventDefault(); if ( $.trim($("#cnmcs-address-input").val()) === "" ) { alert('You did not fill out the postcode field.'); return false; } });02/15/2019 at 12:39 pm #484737Janet Barlagen
ParticipantHi Steven,
I really don’t know where to put this. Is it jquery and do I have to put this around it:
$(document).ready(function() {
//jQuery code goes here
});And can I put it in the head-section or do I have to adjust one of your .js-files?
And where do I put my validation: “\A[1-9][0-9]{3}[ ]?([A-RT-Za-rt-z][A-Za-z]|[sS][BCbcE-Re-rT-Zt-z])\z”Desperate greetz…
02/15/2019 at 2:08 pm #484741Steven Zahm
KeymasterRE: I really don’t know where to put this.
Put the code on line
326right before})( jQuery );in thecn-multi-category-select.jsfile.RE: where do I put my validation
Sorry, don’t know.
02/18/2019 at 7:21 am #484860Janet Barlagen
ParticipantThanks so much Steven!
One more question:
Is it possible to pinpoint the connections on a map?Janet
02/18/2019 at 9:49 am #484866Steven Zahm
Keymaster@ Janet
RE: Is it possible to pinpoint the connections on a map?
Yes, all the premium templates support displaying the entry on a map.
02/18/2019 at 10:39 am #484869Janet Barlagen
ParticipantO, that’s great. But you mean one entry at a time?
Is it possible to display all connections on one map all together?Janet
02/18/2019 at 11:16 am #484873Steven Zahm
Keymaster@ Janet
Sorry, no, this is not yet a feature in Connections.
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
