Hi,
I used h:inputText inside dataTable for the input field. When user clicks(focus) on the input field, I want to have the border changed.
<h:inputText id="field1" onfocus="checkFocus(???)"...>, how can I pass the input field id to checkMouse(??)? I viewed the page source, h:inputText becomes sth. like <input id="form1:table1:0:field1" type="text" name="form1:table1:0:field1" ...(Note "0" in table1:0:field1 dynamically change depends on number of rows, for example, if there are 3 rows in the dataTable, it could be table1:0:field1,table1:1:field1,table1:2:field1)
That means in my
jsp, I should use onfocus="checkFocus(form1:table1:?:field1)". But how can I dynamically pass that arg to checkMouse() in
JSF?
function checkFocus(fieldId) {
if (check) document.getElementById(fieldId).style.borderColor="#E00000";
else document.getElementById(fieldId).style.borderColor="";
}
Thanks,
Sarina