Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formValues() should (optionally) also include hidden rows #548

Open
elsurudo opened this issue Sep 10, 2015 · 5 comments
Open

formValues() should (optionally) also include hidden rows #548

elsurudo opened this issue Sep 10, 2015 · 5 comments

Comments

@elsurudo
Copy link

What are your guys' thoughts on this? Sometimes we want something hidden, but with a value set as well, so it can be submitted.

@memmons-ntst
Copy link

Are you saying that formValues() currently do not include hidden rows?

@elsurudo
Copy link
Author

That is the case for me, yes. Although admittedly, I am using the latest CocoaPod version, and not HEAD. Has this changed?

Essentially, looking at the source, form descriptors have formRows (currently visible rows) and allFormRows (internal property that represents all rows). formValues() uses formRows. It's a similar thing for form sections... can't get an a section by index if it's hidden.

@mats-claassen
Copy link
Member

That is correct, formValues() do not include hidden row values at the moment. This might be a correct enhancement
I do not know why you would want to get a hidden section?
For rows, you can get them by their tag regardless if they are hidden or not.

@elsurudo
Copy link
Author

My use-case is using formValues() as a base to create a web request, and sometimes, even if a field is hidden, I still want to get that value (let's say there is a checkbox like "Use default settings" that sets certain fields on the client-side that I still want submitted).

I agree that not including hidden fields for formValues() by default is probably the correct approach, but it would be useful if that method perhaps took a boolean parameter that specified whether you want to include hidden fields (or a companion method that includes hidden fields).

I'm also finding it limiting to not be able to traverse hidden rows and sections via the form and section descriptors, respectively, since they are defined as private properties.

@multinerd
Copy link

Any changes on this? I have a form with optional hidden rows with default values and i need those default values or if the user changes the value and re-hides the row, i need that new value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants