How do I get the value of an input with getParameter?

0

I can not get the value of the following input.

<input type="text" name="rua" class="form-control" id="rua" 
                                        placeholder="Rua/Av/Estrada" disabled required>

This field is populated through a webservice. What is a "VIACep" mail service.

Only during the registration of this input, I can not get the value that the service places on it.

I'm using getParameter.

String pEndereco = request.getParameter("rua");

The code passes this line and returns null.

    
asked by anonymous 19.08.2017 / 17:53

1 answer

3

Inputs containing the disabled attribute are not sent together with the form data.

Remove the attribute disabled and leave only readonly (read-only) that will work.

Remember that not always webservice will have all values or some may be outdated, so I think you should allow the field to change.

    
19.08.2017 / 18:17