Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 136 through 150 (of 174 total)
  • Author
    Posts
  • in reply to: Limit the number of "favorites" in radio buttons #14290
    EddyPiVEddyPiV
    Participant

    Unfortunately not. The submit button doesn't get dimmed when more than 3 items are marked as specialty.

    in reply to: Limit the number of "favorites" in radio buttons #14251
    EddyPiVEddyPiV
    Participant

    Hi Anh,

    To count the number of favorites, I have the following JS:

    jQuery(document).ready(function( $ ){
    $(document).ready(function () {
      $('.count input').attr('readonly', true);
      $('.radio').change(function () {
        var count=0;
        $('.radio input:checked').each(function(){
          if ($(this).val().replace(/V_/g,'')=="Specialiteit") {
            count += 1;
          }
        });
        $('.count input').val(count);
      });
    });
    });

    That works nicely. (Btw: "Specialiteit" = Specialty, so I'm counting the specialties instead of favorites)

    How to add your code there?
    I created another JS file with the following code, but the submit button never gets disabled.

    $( 'input[type="radio"]' ).on( 'change', function() {
        var $submitButton = $( '.rwmb-form-submit' ).children( 'button' );
        if ( .count() > 3 ) {
            $submitButton.prop( 'disabled', true );
        } else {
            $submitButton.prop( 'disabled', false );
        }
    } );
    in reply to: How to refer to cloneable single_image field? #14250
    EddyPiVEddyPiV
    Participant

    Anh,

    When I add this code to XYZ PHP Code Snippet, the webpage stops loading.
    What am I doing wrong?

    in reply to: Limit the number of "favorites" in radio buttons #14224
    EddyPiVEddyPiV
    Participant

    Hi Anh,

    I have taken up this idea again to limit the number of favorites.
    Currently the number of favorites is counted and that number is shown on screen.

    What I want to do next is to dim the Save/Confirm button as long as the counter is higher than the number of allowed favorites.

    How can I do that?

    in reply to: How to refer to cloneable single_image field? #14221
    EddyPiVEddyPiV
    Participant

    To add here: I guess it would be better to display the images as a gallery, so that the images are all nicely displayed, also if e.g. the 2nd image would be deleted.

    How to disply the images as a gallery?

    EddyPiVEddyPiV
    Participant

    So simple... Excellent! Thanks a lot.

    EddyPiVEddyPiV
    Participant

    Hi, for this purpose I am using the plugin WP Users Media from Damir Calusic.

    in reply to: Change Destination Of Custom File Upload Field Type #13453
    EddyPiVEddyPiV
    Participant

    Hi Anh,

    Great feature!

    I would like to use it in a multisite installation. Is there a way to upload it to an upload folder within that subsite, without hardcoding the sitenumber in the path?

    For multisite installation the regualar path is ../wp-contents/uploads/sites/<sitenumber>/<foldername>.
    Is it possible to specify as path ../wp-contents/uploads/<foldername>, and that automatically the /sites/ and sitenumber are added?

    It would make setting up a new subsite so much easier...

    in reply to: Display fields with confirmation notice #12503
    EddyPiVEddyPiV
    Participant

    Thanks, I'll wait and look for an alternative solution for now.

    in reply to: Limit the number of "favorites" in radio buttons #12476
    EddyPiVEddyPiV
    Participant

    OK, so that will be quite some work. Doubt whether it's worth the efforts.
    Thanks.

    in reply to: Display fields with confirmation notice #12449
    EddyPiVEddyPiV
    Participant

    Anh, how would that work for the Frontend Submission? I read about hooks and actions, but I am not much of a developer myself. I would like to stay on the page after the successful update of the fields, next to the display of the confirmation message.

    How to do that?

    in reply to: Title of post is removed after updating the post #12447
    EddyPiVEddyPiV
    Participant

    Great, that was it.

    Thanks!

    EddyPiVEddyPiV
    Participant

    For my understanding, what this js is doing is counting the number of checked items with class=like, and displaying the counter, right?

    I was wondering, can I also include this in the page from where I launch the Frontend Submission?
    Because then I can control the location where I want the counter to be displayed.

    It would then look like:

    <script>
    var total = 0;
    $( '.like input:checked' ).each( function() {
        total += $(this).val();
    } );
    // Output total somewhere
    $( '#selector' ).text( total );
    </script>

    By the way, I created the .js file, stored it in the js folder of my theme, and included the call in the functions.php, but it doesn't show a counter, and I don't know if it counts...

    EddyPiVEddyPiV
    Participant

    I am trying to understand how this should work.
    Should I include this in the page.php of my theme? Or actually in a separate theme for the frontend submission page to avoid that it is show on each and every page?

    I included it in page.ph, but just the text "var total = 0; $( '.like input:checked' ).each( function() { total += $(this).val(); } ); // Output total somewhere $( '#selector' ).text( total );" is shown on each and every page.
    I am obviously doing something wrong.

    EddyPiVEddyPiV
    Participant

    Hi,

    I have changed my approach. For my new approach I need some guidance as well, but I'll open a new topic for that. Can you close this one?

    Thanks.

Viewing 15 posts - 136 through 150 (of 174 total)