Expand my Community achievements bar.

SOLVED

Hidden field component

Avatar

Level 2

Hi All,

 

I'm exploring AEM Forms on OSGI (AEM 6.0 SP2 + AEM Forms 6 SP2).

During form submit action I need to pass some hidden values. I created a simple component that generates following markup.

<input type="hidden" name="username" value="admin" /> // value can keep changing

Clicking on submit action button does not submit the form. Firebug or Chrome console lists out lot os js error.

On closer inspection I found that unlike foundation forms component, here 

<form>

element does not have any action or method defined. A lot of this is being done via javascript.

 

I similarly have more data I would like to pass via hidden fields bit I'm stuck on the first step.

 

Thanks

Ashish

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi,

Did you not considered using AEM Forms field components which you can hide via visibility expression set to false? For those components, you can prefll value from XML and you would get the same value returned on submit.

Deepak

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

Hi,

Did you not considered using AEM Forms field components which you can hide via visibility expression set to false? For those components, you can prefll value from XML and you would get the same value returned on submit.

Deepak