Forum Discussion

aa1's avatar
aa1
Contributor
5 years ago

Event handler for textbox

Hi,

 

I have a situation where I have an amount text box and then Pay now button beneath it. When I enter the amount, the pay now button should be enabled and then the next step is to click on it. This is an automated script in Jscript. When I do manually, as soon as I enter the text, the pay button does get enabled. But when my automated script runs, it does settext in the textbox but then the button is still disabled. So the next event of clicking on it fails with the exception that the button is disabled. I tried to enable it but seems like I need to have an event handler for this. Do I write the event handler when the textbox has been filled in. Or may be in tab out from that textbox. Please help me to find the right approach.

 

thanks

  • aa1 , I see you are working on this with the Support Team. Currently, they are waiting for more info from you.

    Please provide them with the info so that they could move the investigation forward.

    We will highly appreciate if you share the result of the investigation here:smileyhappy: Thank you.

  • Try using Keys instead of SetText.  That mimics a user typing in the box instead of just updating the field.  Perhaps that will trigger your button.

    • aa1's avatar
      aa1
      Contributor

      Thank you for the reply. Yes I tried that but it made no difference at all. 

      • Marsha_R's avatar
        Marsha_R
        Moderator

        What else have you tried and what exactly happened when you did?   It's hard to help if we have to guess at the details.

  • Wamboo's avatar
    Wamboo
    Community Hero

    In my opinion, the button activates a different action than typing text into it.

     

    Remember that in JavaScript use browser API you can specify many of the locations you want to activate (become available) for other elements on the page.

     

    The text input action can't necessarily be the correct one.

     

    Ask the developer what is responsible for activating the button.


    Is it not a case of a click on a text field or a .focus or .hover, a tab.

     

    In development tools such as Google chrome, you can perform such actions yourself by selecting an item and right-clicking on it,

    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      Community, thanks for your input.

      aa1 were you able to resolve this? 

      • sonya_m's avatar
        sonya_m
        SmartBear Alumni (Retired)

        aa1 , I see you are working on this with the Support Team. Currently, they are waiting for more info from you.

        Please provide them with the info so that they could move the investigation forward.

        We will highly appreciate if you share the result of the investigation here:smileyhappy: Thank you.