I have a little script that allow me to paste a value into different inputs.
<input name="BOO_Price">
<a id="repeatPrice">Repeat</a>
<input name="BOO_Price">
<input name="BOO_Price">
<input name="BOO_Price">
<input name="BOO_Price">
$('#repeatPrice').on('click', function(e) {
e.preventDefault();
var price = $(this).prev('input').val();
$('input[name=BOO_Price]').val(price);
});
It works perfectly.
But now my inputs form are like this.
<input name="BOO_Price[]">
But this is not working:
$('input[name=BOO_Price[]]').val(price);
Ideally, I do not want to had some id
or another sort of classes
.
Could you please help ?