Forum Replies Created

Viewing 15 posts - 91 through 105 (of 147 total)
  • Author
    Posts
  • in reply to: file code.txt validation #26389
    katw
    Participant

    The SLASH at start of $codes line shouldn’t be there so take it out. I didn’t suggest removing a trailing slash, just the one at start of the first line.

    Did you see the directory path change in my code?

    WP_PLUGIN_DIR not WP_CONTENT_DIR

    You could add a debug statement to see what path is being created and then test the path manually to see if you can access the code.txt file from that path.

    You might also see from doing this if the text file contains the correct contents. Sometimes when file security is set wrong the contents shows an error message not the file itself which gives you heads-up you need to fix file attributes.

    add_filter('quform_element_valid_1_37', function ($valid, $value, $element) {
    
       $pathcheck = WP_PLUGIN_DIR . '/surveyhdapg/codes.txt';
       echo '<script language="javascript">';
       echo 'alert("Path:' . $pathcheck .'")';
       echo '</script>';
    
       $codes = file(WP_PLUGIN_DIR . '/surveyhdapg/codes.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
    
       if (!in_array($value, $codes)) {
           $element->addError('Código no válido');
           $valid = false;
        }
       return $valid;
    }, 10, 3);

    I assume you have the correct field reference 1_37 too? You will know soon enough if the alert box appears.

    • This reply was modified 6 years, 9 months ago by katw. Reason: added hint
    • This reply was modified 6 years, 9 months ago by katw. Reason: Slash clarification
    in reply to: Reduce message height #26382
    katw
    Participant

    @omg thanks.

    You can do the style adjustment within Quform or you add the style override within your theme css.

    Within Quform:

    1. EDIT the textarea field you want to adjust.
    2. Choose STYLES tab. You can play with the preset field size options in “FIELD SIZE” or for more precise control:
      1. goto bottom CSS STYLES option
      2. click ADD
      3. Choose TEXTAREA FIELD from “Selector” popup.
      4. Type in your CSS. in this case: height:XXXpx; or whatever measurement you want EM or REM etc
    3. Click [save] to close field edit dialog
    4. Remember to [SAVE] form.

    OR

    Outside Quform:

    Edit your theme CSS and add:

    .quform-1 .quform-field-1_28 {
       height:80px;
    }

    Change .quform-1 to match your form ID. (1 = first form)
    Change the 1_28 number to match your textarea field ID number.

    Hope this has helped a little.

    • This reply was modified 6 years, 9 months ago by katw. Reason: Fixed markup
    Attachments:
    You must be logged in to view attached files.
    in reply to: Reduce message height #26370
    katw
    Participant

    @omg

    Can you do a screenshot to explain what and where you mean?

    in reply to: Change form font #26368
    katw
    Participant

    Hi @omg

    Thought I could help out.

    Does your form use one of the Preset Styles or THEMEs ?

    If unstyled (no-theme) the form font or typeface comes from your WordPress Theme and its various stylesheets.

    Have you been doing customisation with styles in Quform? Check your Global CSS Styles for any mention of font-family etc.

    Otherwise:

    The quickest way to find out where the style controls are coming from is using the developer tools in your browser (Inspector).

    Attachments:
    You must be logged in to view attached files.
    katw
    Participant

    Thank you,

    your help was awesome.

    Close ticket

    in reply to: file code.txt validation #26365
    katw
    Participant

    Hi @Icemanmx

    Saw your post and thought I could help.

    You said your code.txt file is in the plugin folder – yes?

    If yes, the code you are using is looking for file in WP Content folder. Also you have a leading slash at start of the line which shouldn’t be there.

    Try:

    add_filter('quform_element_valid_1_37', function ($valid, $value, $element) {
       $codes = file(WP_PLUGIN_DIR . '/surveyhdapg/codes.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
       if (!in_array($value, $codes)) {
           $element->addError('Código no válido');
           $valid = false;
        }
       return $valid;
    }, 10, 3);
    katw
    Participant

    Hi Ally,

    any chance you could get back to me on this?

    Thanks

    in reply to: quform Javascript options #26321
    katw
    Participant

    Hi Ally,

    I notice the page mentions examples but shows only the table of parameters.

    Will you be updating this document?

    Thanks

    Kat

    in reply to: Custom email content QuForm 2 #25796
    katw
    Participant

    Thanks for that, will give it a go.

    CLOSE ticket

    katw
    Participant

    @Ally

    Cool!

    I assume we make a plugin like normal or add to functions.php?

    in reply to: Quform centering #25624
    katw
    Participant

    Hi @blackbeard

    Try:

    .quform {
        max-width: 100%;
        width: 600px;
        margin: 0 auto;
    }

    This class is the outer most wrapper of the form.

    in reply to: Manually resend notification emails #25610
    katw
    Participant

    Was this feature added?

    As 2.2.0 doesn’t show this as an option in Entries List or edit view.

    Would be great to have.

    in reply to: Warning When Leaving Unsubmitted Form #25608
    katw
    Participant

    Hi @mgoldsm7,

    Thought I may be able to give you some ideas to try:

    If the form you want completed resides on particular page you could check the URL before you attach the event to “nag them”.

    That way you would only run the “exit check” on the page that matters.

    var current_url = location.href;

    This returns the full url with all parameters, so to focus on the page name you need to isolate the page name from the querystring like so:

    var url = location.href;
    var url_bits = url.split(‘?’);
    var main_part = url_bits[0];

    In your (document).ready function you would get the page name then test if page equalled the page that matters then run/attach the on submit event.

    $(document).ready(function() {
    
    // INSERT CODE TO GET URL - What page am I on?
    
    // INSERT CODE TO TEST IF (PAGE == 'important_form') { 
    
    $(“#quform-form-146d47”).on(“submit”, function(e) {
    $(window).off(“beforeunload”);
    return true;
    });
    
    // INSERT END IF
    });

    If the page name is known by a number of names (aliases) you would need a list of aliases to test against. Method would work but IF would be checking against an array of names and/or checking query string too.

    • This reply was modified 7 years ago by katw. Reason: fixed typo
    katw
    Participant

    A small request.

    Could you in next release add class names to the html lists you auto generate for notifications for multi-select, checkbox and file elements.

    I.E Change the getValueHtml() function to add a CLASS name. A different one for files, checkbox and multi-select elements as styling may need to be different.

    Using advanced selectors in email html is not possible. The ideal solution is a custom setting where we can define the custom inline style we want attached to the UL and another for the LI elements.

    You would then insert a style=”<our code>” to the UL, and the other style code to each LI

    Give it thought.

    • This reply was modified 7 years ago by katw. Reason: added function I was referring to
    • This reply was modified 6 years, 12 months ago by Ally.
    katw
    Participant

    Which environmental value would HTML Email notifications use?

Viewing 15 posts - 91 through 105 (of 147 total)
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy