Skip to Content
0
Former Member
Jul 20, 2005 at 06:26 PM

Javascript in the htmlb:inputField

39 Views

Here is the brief description of the problem:

I have a table view in which i display the htmlb:inputField which are created in the iterator. I need to capture the ENTER Key event and set the focus to the next field in the next row.

I have seen examples of the normal input field but couldnn't somehow figure out a way to do it in the htmlb:inputField. Here is the sample code which i tried to play around with (for normal input fields.)..

<i>function enter(nextfield) {

if(window.event && window.event.keyCode == 13) {

nextfield.focus();

return false; }

else

return true; }

</script>

Field 1: <input type="text" name="field1"

onkeypress="return enter(document.demo.field2)"><br>

Field 2: <input type="text" name="field2" onkeypress="return enter(document.demo.field1)"><br></i>

<b>How do i use this code in the iterator for my htmlb:inputField ? i did try the following attributes

1) submitOnEnter

2) onValueHelp

3) doValidate

but none on them could help me..

</b>..

Any help would be appriciated.

Amandeep.