Dear, I see myself in the following situation where I can not imagine a solution:
We have a selection field in html containing some Brazilian states and the Federal District, when choosing an option, this would lead me to open another type of choice a radio button, between Capital and Interior being each capital and the option of interior with their respective values, where I would take this value of the given capital or the interior and would take to make an account multiplying a value of another radio button equivalent the daily ones to there then to show that value in a text field.
Exemplo
Numero de diárias: ()Uma diária (x)Duas diárias ()Três diárias
Selecione o estado: Select SP\/
//Apareceria outro radio button:
(x)São Paulo () Interior
In the case of São Paulo, the value would be R $ 200.00 per day
then the textfield with the javascript help would be:
Value = 400.00
<select name="estado" id="estado" >
<option name="nenhum" value=""> Escolher </option>
<option name="DF" value="DF"> Distrito Federal </option>
<option name="SP" value="SP"> São Paulo </option>
<option name="outros" value="Outros"> Outros Estados
</option>
// Open multiple choice of two options if the user chose the Federal District, then
<input required="required" value="Brasília" name="capital" type="radio">
<label for="capital">Brasília</label> <input required="required" value="Interior" name="capital" type="radio"><label for="capital">Interior</label>
// Note that depending on the select field the valor
and the label
of the radio button would change. Home
// Soon after the daily to Brasilia has value of 250.30 and the interior is fixed for all the states 160.00. Home
At this point I would need to make the account I imagine with IFs
for each capital and multiply with the value of the daily element of the radio button up there.
That was the way I thought. Would I have to do this or any other way in which I would achieve the same result? That is to have the name of the capital to be able to record in the database, and the amount of capital to make the account with the daily. How could I do this in Json or Javascript?