A
A
Alex2015-02-15 11:29:11
Angular
Alex, 2015-02-15 11:29:11

How to change form elements depending on selected select value in angularjs?

Hello. For example, there is such a dropdown list:

<select>
  <option>Пункт 1</option>
  <option>Пункт 2</option>
</select>

And there is, for example, 2 <input type="text"/>
How to make it so that when choosing item 2, add new inputs, or delete them?
Thank you.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Max, 2015-02-15
@zenwalker

<select ng-model="select">
  <option value="val1">Пункт 1</option>
  <option value="val2">Путкт 2</option>
</select>

<div ng-if="select == 'val2'">
  <input type="text">
</div>

D
Dimonchik, 2017-10-15
@dimonchik2013

antibot protection, for example
https://httpbin.org/ check everything here

P
Pavel Kornilov, 2017-10-15
@KorniloFF

file_get_contents returns the contents of the file as a string, without executing it, so everything is logical.
If you connect it via include, it will be executed.

T
ThunderCat, 2017-10-15
@ThunderCat

it is obvious that the file does not return anything, it means that the cant is most likely in the request, see what is passed to the request (stupidly debug output), then drive the request into sql with your hands, for example, in the muscle front, or in the console, and see what the select returns. Most likely, either these curves come, or there is a problem with the request.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question