SAB Form

  • I noticed, that I can't install the SAB Form v1.0.1 from the marketplace on a production environement, it just says:

    Code
    1. Loading composer repositories with package information
    2. Updating dependencies
    3. Your requirements could not be resolved to an installable set of packages.

    Installing with debug mode enabled, does not give me more intel.


    The weird thing is that, if I install the same zip which i released at the marketplace via upload at System > Extensions there is no error (as expected, running the required PHP v7.1 and Pagekit 1.0.15). I have no clue how to approach this problem.


    Any hints?

    The LORD is my strength and my shield; in him my heart trusts, and I am helped; my heart exults, and with my song I give thanks to him. Psalm 28,7

  • I guess it's probably because of php 7.1?


    As pagekit needs way lower, or because of pagekit 1.0.15 as I never seen in any extension that a pagekit requirement.


    The package should be installable without marketplace too right? So probably a test run with one if those disabled and second with lower php version, even it's not helping at all but just to catch the root of the installation problem.


    Regards,


    Fossy

  • The current environment for testing meets the requirements. But installing the same release file (a zip) results in success via the upload method but will fail via marketplace.

    The LORD is my strength and my shield; in him my heart trusts, and I am helped; my heart exults, and with my song I give thanks to him. Psalm 28,7

  • SAB , this is just great and works perfectly with UIKit3. Just a quick question. If I have an inout field "xyzzy", how can I reference this in the Subject and Desc attributes? Would you have an example? I will then post a nice example including success/error, ... Thanks!

  • Mercator you can use every input value when you use "dynamic" attributes ( in vue js v-bind: or shorthand just :)


    PHP
    1. <input type="email" name="email">
    2. <input name="subject">
    3. <send :to="email" :subject="subject"></send>


    I updated the form to v1.0.3 as I removed the captcha fix which is now solved with the new pagekit version. But it is still not installable from marketplace ...

    The LORD is my strength and my shield; in him my heart trusts, and I am helped; my heart exults, and with my song I give thanks to him. Psalm 28,7

  • Mercator you can use every input value when you use "dynamic" attributes ( in vue js v-bind: or shorthand just :)



    Hi SAB , thanks, that I understood but - using your example, how do I add the name to the <<desc>> field, which holds the body of the message? O would like to send something like "Dear <<name>>, thanks for contacting me ..." in the body of the message.

  • SAB first of all thank you very much for this extension it's really just super awesome freedom seems to be. Love it!


    I still have one question about validation of email adress. I used uikit 3 alert class for outputing error messages like this:



    It's working almost perfect, one thing that i can't understand why test@test can be valid value. Probably you have a clue how to fix it?


    Regards,


    Fossy

  • Is that valid vue syntax? v-if="form.email.invalid" && v-if="form.email.email"

    Souldn't it be v-if="form.email.invalid && form.email.email"?

    The LORD is my strength and my shield; in him my heart trusts, and I am helped; my heart exults, and with my song I give thanks to him. Psalm 28,7

  • Hi Simon,


    I tried the one you wrote before but it wasn't working for me at all. The other is except es I said the bug.


    This bug I can reproduce even without the code for showing the message when email adress is invalid.


    it's visible in the vue console during debugging on that it switch automaticly to valid when name@domain is written without a dot. When you write a dot then it'd invalid again and yo have to provide another two letters for regular domain ending.


    Regards


    Sven

  • It is enough to just check the invalid property, as it gets true as soon one validator of the field fails. So it's the general state. If you use multiple validators on a field and you want to give more specific messages, then you can check the value of the validator itself.


    The email validator is a regex of pagekit/vue-form, there could be an error.

    JavaScript: vue-form/src/validators.js
    1. export function email(value) {
    2. return /^([a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*)?$/i.test(value || 'a@a.aa');
    3. }


    The validator for email & url are by default set. Actually you can just add the plain attributes, without the prefix v-validate:, as the extension sets it itself. That allows to use html5 validation and vue validation in one go.


    Available validators:

    Applying the validators:

    I planned to set more validators by default, but I can confirm, that some have unexpected behaviour e.g. maxlength returns false if no value provided ...

    The LORD is my strength and my shield; in him my heart trusts, and I am helped; my heart exults, and with my song I give thanks to him. Psalm 28,7

  • Hi Simon,


    if I check for invalid only then the error message with UK alert class is shown directly after loading the contact form page.


    That's why I wanted to add a second validation property to prevent this behavior. Which is working so far and even the regex seems be fine its behaving slightly different.


    You want the url to check it yourself? I would P.m.it to you.


    Thanks for your effort anyway, very informative reply as usual for a newbie like me. 👍


    Regards


    Sven

  • SAB


    Hi Simon,


    I have took a closer look on your extension, but something i don't get at all somehow. You have a send.vue file, but if I extend it slightly it does not applies. I don't saw as well that it is getting compiled by webpack, as no entry could be found in the config file. Is it something for future release and not complete yet?


    As I still would like to implement all the status messages with the modal componant, it would be easier to modify the template I guess.


    Thank you for your reply in advance.


    Regards


    Sven


    edit:


    Got it! Works fine so far.


    send.vue add new line after line number 58.

    Code
    1. UIkit.modal('#kontakt-form-modal').show();


    Then just add on bottom before closing the form something like this:


    Works like a charm for me. <3 this extension it's deffo the best so far when it comes to create a contact form on a pagekit site. :thumbup: