0

My code

<form name="Form" id="form">

<input type="hidden" name="group" id="group" value="" ng-model="myModel.group">

<a ng-href="#" class="btn next-step" ng-click="myModel.group='live'">Select <i class="fa fa-arrow-circle-right"></i></a>

</form>

Before I click button, input's log looks like big object:

$$debounceViewValueCommit,
$$lastCommittedViewValue,
$$parseAndValidate,
$$rawModelValue,
$$runValidators,
$$setOptions,
$$success,
.........

But when I set value - field becomes a string.

So, hidden field should change it's value on button click. And it also should be available for validation by $isValid and $dirty and ctr.

So how to set value in Angular way?

4
  • Not really sure I understand what do you mean by change form input value dynamically, could you please reformulate your question ? Commented Jul 20, 2015 at 7:35
  • I just want to set a value of form input dynamically. But I don't know how to do it with angular way. Commented Jul 20, 2015 at 7:44
  • Is your input meant to be hidden? You also have an ng-href directive in both your opening and closing tag. Commented Jul 20, 2015 at 7:48
  • Yes, input is hidden. But it should change it's value on button click. And it also should be validateble by $isValid and $dirty and ctr. Commented Jul 20, 2015 at 7:51

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.