I have the following Input in my file .html
<input type="text" class="form-control" name="option[]" id="option[]">
Whenever the user clicks the +
field on the next button, it creates another input
equal to that.
I'm trying to get this value with JavaScript as follows:
var inputs = document.getElementsByTagName('input');
for(var i=0;i<inputs.length;i++){
if( (inputs[i].name).indexOf('option')>-1 && inputs[i].value!="") {
inputs ++;
}
}
And then I need to pass this value through POST and move to my .php
page,
which I get there as follows:
if(isset($_POST['option[]'])){
$cc = array($_POST['option[]']);
}