• Resolved Vipa

    (@vipa)


    Hey thanks for the plugin!

    When I set a field to required <em>*</em> is automatically set for the label and it cannot be removed. I do not want to use the label at all but placeholder texts instead. Any chance to remove the *?

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    this is the default.

    You can,
    – delete it from your label field (in the UI grid editor) and save your form.
    – modify the default behavior when you create a new form using hook #3 (see screenshot #21).

    Thread Starter Vipa

    (@vipa)

    Hey, thanks for you response.

    I tried deleting it, as soon as I leave the label field it is readded.
    I will check out the hook. You say “when you freate a new form” so this is only working for new forms?

    Thanks!

    Plugin Author Aurovrata Venet

    (@aurovrata)

    soon as I leave the label field it is readded.

    Readded? Not sure what you mean.
    If you create a field and add text to a label and you delete the required html markup the label will appear without the asterisk sign.
    If you don’t need the label you can insert “&nbsp” character for a non breaking space.

    this is only working for new forms?

    Actually any new cell you create (new row or new column) will be affected by the filter once you reload the form edit page.
    Existing fields/cells will not be changed.

    Thread Starter Vipa

    (@vipa)

    soon as I leave the label field it is readded.

    Readded? Not sure what you mean.
    If you create a field and add text to a label and you delete the required html markup the label will appear without the asterisk sign.
    If you don’t need the label you can insert “&nbsp” character for a non breaking space.

    This does not work for me, whatever I try, the asterisk comes back.
    Here is a video to clarify:
    https://www.youtube.com/watch?v=DyW3R7m3Ge8

    this is only working for new forms?

    Actually any new cell you create (new row or new column) will be affected by the filter once you reload the form edit page.
    Existing fields/cells will not be changed.

    Ah ok, I thought my filter wouldn`t work, but for new cells it does.

    add_filter( 'cf7sg_required_cf7_field_html', 'filter_required_html', 10, 2);
    function filter_required_html($html, $cf7_key){
      //the $html string to change
      //the $cf7_key is a unique string key to identify your form, which you can find in your form table i nthe dashboard.
      if('kontaktformular-1'==$cf7_key ){
        $html =  '';
      }
      return $html;
    }
    Plugin Author Aurovrata Venet

    (@aurovrata)

    This does not work for me, whatever I try, the asterisk comes back.

    ya, my mistake. I made a small change to the js script which allows individual labels to be changed manually by inserting a span markup. (see faq #17)

    so something like <span></span> will not show anything.

    hope that’s clear.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    ps:

    Hey thanks for the plugin!

    do leave a review

    Thread Starter Vipa

    (@vipa)

    ya, my mistake. I made a small change to the js script which allows individual labels to be changed manually by inserting a span markup. (see faq #17)

    so something like <span></span> will not show anything.

    Ah, I see. This works, thanks!

    do leave a review

    I will.

    Thread Starter Vipa

    (@vipa)

    Just wanted to let you know that it works as expected with the new version.

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Forced * in label when field is required’ is closed to new replies.