Could someone please tell me how can I update the value of outputText via. Java Scripts. I have this huge dynamic datagrid, with many columns two of which are to enter pin numbers per row (enter pin & reEnter Pin).
I made a Java Script for the onchange event of the reEnter Pin, that compares its value with the enter Pin. In case the values are not the same I need an indication on that row : "*" in bold red, to indicate that the values are not correct.
I am assuming you are already doing the below.
What you might be missing is the place holder for the '*'. For this you have to create a 'DIV' element. Usually this can be created directly by having hutputText with "ID" attribute. Set the style for this 'DIV' element to 'display:none' initially. Now in your onchange() / onBlur() function, you could have the function that sets the styple
Note - This can be done easily if you have consistent naming for the field values. A sample example is as below. You would have to replace the parameters appropriately if you plan to use this function below.
Joined: Sep 14, 2001
I had write the above since javaranch is parsing the content of the response
If you would like to try it out in JSF, you can use a validator method in your backing bean. Set the rendered attribute of outputText '*' to true if the validation fails. You may want to bind the enter pin and the reenter pin inputText elements as well as outputText element to backing bean properties in order to access them in your validator method.
I have this huge dynamic datagrid, with many columns two of which are to enter pin numbers per row (enter pin & reEnter Pin).
Do you mean that you have these enter pin elements in every row? If so you may also need to bind the datagrid to a backing bean property in order to loop through the rows. Hope this gives you some idea.