colinkeefe Posted October 22, 2004 Posted October 22, 2004 Well, not exactly XML specific, although this is going into an xslt page. I've been asked to build a web form for a user who must do all data entry using a numeric keypad. I would like a way to substitute the behavior of the Enter key with the Tab key - so she can "tab" through the fields using the Enter key on the numeric keypad. I don't think accesskey tags will work here. Of course, this might mean the behavior of the "submit" button will be broken, but I'll deal with that after I find out whether the above request is even possible. Any ideas? thanks in advance, Colin
transpower Posted October 22, 2004 Posted October 22, 2004 Layout Mode | select fields | Format | Field Behaviour | Go to next field using Enter or Return [not Tab]
colinkeefe Posted October 22, 2004 Author Posted October 22, 2004 And the XSLT page will inherit this behavior? Really? How?
transpower Posted October 22, 2004 Posted October 22, 2004 Not sure. Chapter 23 of Using FileMaker 7 devotes a lot of pages to this topic...take a look at that.
Garry Claridge Posted October 22, 2004 Posted October 22, 2004 You may be able to use a Javascript solution. The Javascript would be embedded into the XSLT. Good Luck. Garry
colinkeefe Posted October 22, 2004 Author Posted October 22, 2004 That's more or less what I thought - except I'm not too javascript savvy, and can't see a simple way to implement it. So far as I can tell the Return key is bound to form submission, and can't be bound to another behavior. I seriously doubt any kind of field behavior inheritance is passed through the XSLT Assistant - not unless FM programmers put some serious javascript-writing stuff into the wizard too. However, I just realized that the character strings the user will be entering are probably going to be fixed-length. Maybe I can use the length of the data entered to shift focus to the next field...which means I wouldn't need to have the user trigger moving to the next field manually anyway! hmmn this web stuff is all new to me... Thanks Garry Colin
Garry Claridge Posted October 23, 2004 Posted October 23, 2004 You can have a function, similar to this, in the <head> of your page: <script> function RetToTAB() { document.myform.nextelement.focus; } </script> Your Form tag may look like this: <form name="myform" action="......" method="POST" onsubmit="RetToTAB(); return false;"> You will need to work-out which is the currently focused element and hence which is the "nextelement". To submitt the Form you would have another Function which uses: document.myform.submit(); You could have an <a> tag which calls that function. You could also use other Javascript DOM functions to check focus, onchange, etc. Good Luck. Garry
colinkeefe Posted October 24, 2004 Author Posted October 24, 2004 Thanks, Garry - I'll give it a try today... Colin
colinkeefe Posted October 25, 2004 Author Posted October 25, 2004 Well, I've tried about 5 different javascript solutions, which I can get to work in a straight-up html web form, but can't get to work inside an xslt page. Anything I should know about here? I've tried referring to the form elements by field name, giving the elements explicit names (which seem to get overwritten by the WPE with the fieldname anyway...) Most of the time the page fails to load altogether; sometime it loads but the javascript is stripped out when you view source - just the open and close tags are there. Just some pointers, like stupid things to not do, etc, would be helpful.
colinkeefe Posted November 2, 2004 Author Posted November 2, 2004 Okay, I'm *still* working on this. I'm attaching a simplified version of my code, with two fields. I'd welcome any help from a Javascript guru... With javascript, it fails, without, it works fine. Note that the only change to the tags outside the header javascript is in the input tags, i.e. instead of: input size="8" type="text" maxlength="8" I have input size="8" type="text" maxlength="8" name="Child_ID" onFocus="nextfield ='Therapist_ID';" with open/close carats, obviously - when I put them in they get read as html by the post engine... Any help appreciated, thanks! Colin
Recommended Posts
This topic is 7324 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now