Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
85
rated 0 times [  92] [ 7]  / answers: 1 / hits: 53667  / 12 Years ago, sun, june 24, 2012, 12:00:00

How do I access hidden fields in angular? I have an app, where I want to submit a form for each of items in the list. The form is simple - it has submit button and a hidden field holding the ID value. But it does not work. The value is empty.



I updated the default angular example to display the situation - the todo text is in hidden field.



http://jsfiddle.net/tomasfejfar/yFrze/


More From » angularjs

 Answers
44

In your simpler fiddle, the problem can be fixed by using ng-init or setting an initial value in the controller. The value attribute won't effect the ng-model.



http://jsfiddle.net/andytjoslin/DkMyP/2/



Also, your initial example (http://jsfiddle.net/tomasfejfar/yFrze/) works for me in its current state on Chrome 15/Windows 7.


[#84699] Friday, June 22, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jaleelh

Total Points: 661
Total Questions: 125
Total Answers: 103

Location: Sweden
Member since Mon, May 8, 2023
1 Year ago
jaleelh questions
Tue, Feb 23, 21, 00:00, 3 Years ago
Tue, Jan 19, 21, 00:00, 3 Years ago
Wed, Aug 26, 20, 00:00, 4 Years ago
Mon, Jul 27, 20, 00:00, 4 Years ago
;