2
I’m having trouble transforming values from a Toggle input into a string value to be stored in a BD. The goal is to make a Buy/Sell Toggle that shows the type of operation the user is entering the information, returning, in string, a "C" or "V" depending on the option:
But I’m not getting the value of Toggle!
This is the code I’m doing to take what the button comes out and turn it into the strings
<script>
$(document).ready(function () {
if ($("Tipo_ope").val().toLowerCase() === 'true')
return "C"
else
return "V"
}
);
</script>
I also tried for the Controller, but I can’t get the result by the parameter, and it didn’t work either... I am still beginner in this MVC method and still do not understand some things, so I ask if there is someone who knows how to solve this?
would not be ideal... the field will be consulted in an Index and it would have to be specific. But thank you! He managed to clear up some things that he wasn’t getting
– Rone Filho
I get it. If my answer helped you clear your doubt, please mark it as accepted. Otherwise, comment on the remaining doubt so I can edit it.
– M. Bertolazo