Juan Carlos Alvarez
Juan Carlos Alvarez

Reputation: 70

Set value of hidden input inside form HtmlUnit

(HtmlUnit/Java/NetBeans 7.3)

How do you set the value for hidden inputs inside a form. I have a form, an it has the hiddens. No need to add hiddens.

I have the values and I just need to set those inputs with such values.

Thanks everyone!

HTML code

<tr id="theRowprof_1_54066" style="display:table-row;">
<td valign="top">
<input type="text" readonly="" onclick="buscaProf('79FA9300D2DC4BDE');" value="STAFF" size="6" name="p_profesor_1_54066">
<input type="hidden" value="" name="p_profesor_pidm_1_54066">
<input type="hidden" value="100" name="p_responsabilidad_1_54066">
</td>
</tr>

Upvotes: 3

Views: 2703

Answers (1)

Kick
Kick

Reputation: 4923

You have not provided the source code so i m providing the code assuming that hidden input contain ID attribute.

HtmlHiddenInput hidden  = (HtmlHiddenInput) page.getElementById("Hidden_Id");
hidden.setValueAttribute("Updated_Value");

Upvotes: 3

Related Questions