Jump to content
Manol

hide field

Recommended Posts

I'm trying to hide an inputfield but label still appears:

$field = $modules->get("InputfieldText");
$field->attr('id+name','name');
$field->attr('v-model','usuario');
$field->attr('style','display: none');
$field->required = 1;
$form->append($field);

476391784_Capturadepantalla2018-05-30alas18_11_54.png.e7e20b49b473442bebb056a8cb113a51.png

Share this post


Link to post
Share on other sites

If that field should only transport some additional data, why not simply add some markup?

$form->appendMarkup = "<input type='hidden' name='some-name' value='some-value' />";

 

Share this post


Link to post
Share on other sites

Is a form with several fields that is populated via vuejs, and  just need a submit button to show up.

Share this post


Link to post
Share on other sites
$your_field->label = ''; //first need to set field label as empty string (important!)
$your_field->skipLabel = true; //works only if the label is set to empty string

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Use a hidden inputfield:

$field = $modules->get("InputfieldHidden");

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...