How to pass new hidden value to backing bean in JSF

In some cases, you may need to pass a new hidden value to a backing bean. Generally, there are two ways : 1. HTML Tag + getRequestParameterMap() Render hidden field with plain HTML input, hard-coded new hidden value and access in backing bean via getRequestParameterMap() method. JSF… <h:form id="myForm"> <input type="hidden" name="hidden1" value="this is hidden2" …

Read more

JSF 2 hidden value example

In JSF, you can use the <h:inputHidden /> tag to render a HTML hidden value field. For example, JSF tag… <h:inputHidden value="some text" /> Render this HTML code… <input type="hidden" name="random value" value="some text" /> JSF hidden field example A JSF 2 example to render a hidden field via <h:inputHidden /> tag, and access the …

Read more

How to get hidden field value in JavaScript

In JavaScript, you can use following two ways to get hidden field value in a form : document.getElementById(‘hidden field id’).value document.formName.elements[‘hidden field name’].value See an example here… <html> <body> <script type="text/javascript"> function printIt(){ alert(document.getElementById(‘abcId’).value); alert(document.formName.elements[‘abcName’].value); } </script> <h1>Access Hidden value in JavaScript</h1> <form name="formName"> <input type=hidden id="abcId" name="abcName" value="Wall Street! Money Never Sleep"/> <input type=button …

Read more

Spring MVC hidden value example

In Spring MVC, you can use <form:hidden /> to render a HTML hidden value field. For example, <form:hidden path="secretValue" /> It will render the following HTML code <input id="secretValue" name="secretValue" type="hidden" value="I’m hidden value"/> P.S Assume “secretValue” property contains value “I’m hidden value”. In this tutorial, we show you how to use Spring’s form tag …

Read more