0
Hello,
Watching objeto_receita
I get the following data:
After receiving this data, I assign its value to the respective fields.
Basically using the function below:
function objeto_form() {
$('#txt-descricao').val(objeto_receita.descricao);
}
As for that, all right, I can fill out the form normally.
But when checking in html, I realize that the value of the element is empty.
So how can I get the value of the element?
I know this way, I can $('#sel-conta').val();
But because this element is empty when viewed in html ?
Using the function below, shows me an empty value.
function(elem){
var value = elem.value;
var id = elem.id;
}
how are you making sure that
objeto_receita.descricao
really contains something, and that function is actually being called? And are sure not to have more than one equal ID on the page?– Bacco
If I look at the console I can see, apart from that, the description field is being populated.
– Wagner Fillio
And where are you checking HTML? Remember that if there is any page change, the value does not persist.
– Bacco
all right, I’m aware, the value is being recovered and displayed in the field, but in the modal, when checking the value manually, I can’t see the value attribute.
– Wagner Fillio
I wonder how the modal bootstrap gets the arrow the recovered value without filling the
data-value
.– Wagner Fillio
It would be nice if you could have [Dit] and provide more details, just what you went through is difficult to test, without a proper context. The possibilities are many, and what you have in question is very limited. If you could reduce your code to a [mcve] it would help.
– Bacco
Already tried to select the element in the inspector and write to the console:
$0.value
?? Maybe you’re confusing the concept of property and attributes.– fernandosavio
I edited the question and tried to explain it better. I have already selected the element through element.value and it is empty
– Wagner Fillio