Gettigg Info from Entry Field.
December 30, 2004 12:00 AM
We are attempting to use an entry field and assign its contents to a variable when either a button is clicked or the Enter key pressed. We can get the button click to work, but don't know how to get the contents of the entry field into the variable based on Enter key being pressed. Any ideas would be appreciated.We are attempting to use an entry field and assign its contents to a variable when either a button is clicked or the Enter key pressed. We can get the button click to work, but don't know how to get the contents of the entry field into the variable based on Enter key being pressed. Any ideas would be appreciated.
Discussion (3)
Actually, Aaron, what I'm trying to do is in the opposite direction. I know how to insert the contents of a variable into the entry field. I want to go the other way... I want to take what the user types into the entry field and store it in a variable.Actually, Aaron, what I'm trying to do is in the opposite direction. I know how to insert the contents of a variable into the entry field. I want to go the other way... I want to take what the user types into the entry field and store it in a variable.
All form fields have an associated variable with it. So if they type something into the field, it will change the value of the variable to what was entered. Be warned up front that Netscape/IE and entry fields cause havoc (the clicking on a text HREF instance will trigger the HREF action BEFORE the entry field loses focus and updates the variable.) This is also true if you have an on keystroke action tied to the enter key, but the field still has focus (the cursor is blinking inside of it.) So, if you have to capture this scenario, have an action to call a javascript function called trivUpdateEntry() to make sure the entry field variable is updated prior to issuing the HREF action. This can be done by using a go to webaddress action with the url: javascript:trivUpdateEntry();Edited By: aaron on 38351.6963194444
A change contents action may be used to accomplish this. The entry can be updated to display the value of any variable within the title. You may need to have another action, which first sets the value of the variable using a modify variable action and then have the other action change the contents of the entry field to this variable.A change contents action may be used to accomplish this. The entry can be updated to display the value of any variable within the title. You may need to have another action, which first sets the value of the variable using a modify variable action and then have the other action change the contents of the entry field to this variable.
Discussions have been disabled for this post