Update Value Without Clicking Outside of Field?

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • In Progress
Is there a way to update the value in a field without having to click elsewhere on the page first?

I have a page with a single text entry field and a formula URL "Enter" button that compares the value in the field with an existing value when clicked. I've noticed that the formula does not update until the user clicks outside of the text field in question after entering a value. If I enter a value and immediately click the button it updates the value and does nothing (must be clicked again to work) or if I hit the enter/return key, it does not compare the current value and comes up wrong. Can I ensure that the formula URL updates as text is entered into the input box? Can provide more details, if necessary. Thanks!
Photo of rhuffman

rhuffman

  • 328 Points 250 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 53,842 Points 50k badge 2x thumb
Can the data entry be a drop down list, or does it need to be free form?
Photo of rhuffman

rhuffman

  • 328 Points 250 badge 2x thumb
Has to be free form, due to the nature of the page's functionality.
Photo of rhuffman

rhuffman

  • 328 Points 250 badge 2x thumb
I haven't fully implemented this but I think I figured it out. Using Dan's world famous IOL technique and handy dandy JavaScript, I am going to add an "oninput" event to the input element and trigger the OnBF(this) that is normally triggererd when the element is blurred (or no longer selected, as happens when we click outside of the input field). This way, every time the user types a new character, the input element performs the same action as when we click away from it, thus updating the formula for the "Enter" button.

´╗┐EDIT:´╗┐ I did also have to add an "onkeypress" event handler to the text box to click the button as well because hitting the enter/return key was not registering as clicking the "Enter" button because it is a link element rather than a form submit.
(Edited)