cancel
Showing results for 
Search instead for 
Did you mean: 

Capture the value entered in Input field .

shiny_victoria
Explorer
0 Kudos
188

Hi,

I have a BSP application embedded in a PCUI application. In the BSP, i have many input fields.

When I edit the input field, the value is not gettng captured unless I hit the <enter> key.

User is not aware of this, so it is not user friendly too.

Is there any way that I can capture whether the input field is edited or not?

Please note the layout is designed using the tag <htmlb>.

Any suggestions?

Regards,

Shiny

Accepted Solutions (1)

Accepted Solutions (1)

former_member184111
Active Contributor
0 Kudos

Hi Shiny

With the following code it is possible to call the different events that are available

in HTML for a HTMLB inputField.

<bsp:findAndReplace find    = "<input"
                          replace = "<input onChange >
        <htmlb:inputField id        = "t2"
                          value     = " "
                          alignment = "left" />
      </bsp:findAndReplace>

You can capture the value of input field onChange or onBlur events...using JS.

Regards,

Anubhav.

shiny_victoria
Explorer
0 Kudos

Hi Anubhav,

First of all, Thanks a lot. Solved my problem.

One more question is :

I have more that 5 input fields, so I didnt want to alert the user each time there is a change in the input field. So I have kept a flag for all the change that is happening. Now, I have to alert the user when he is trying to go out the page.

Any suggestions?

Regards,

Shiny

former_member184111
Active Contributor
0 Kudos

Hi Shiny,

If you need only to alert the user and let him navigate away from the page after he clicks 'OK' on alert box , you can use the onUnload event.Refer to below thred for more info..

[]

Regards,

Anubhav.

shiny_victoria
Explorer
0 Kudos

Anubhav,

Is there any way that I can stay in the same page after giving the alert?

Regards,

Shiny

former_member184111
Active Contributor
0 Kudos

Hi,

For that you have to use the onClientClick event of SUBMIT button(or any other button,which when pressed takes user to other page) .

After OK is pressed on alert box cancle the processing of onClick, so that user can not navigate if he gets an alert.

Anubhav.

shiny_victoria
Explorer
0 Kudos

Hi Anubhav,

But for my page there is no buttons available. I need this alert when user tries to click another Tab page or change value in a drop down. But the tab page n drop down are all designed by PCUI application.

Any solution on this?

Regards,

Shiny

Answers (1)

Answers (1)

former_member188685
Active Contributor
0 Kudos

you can find the information only by pressing the enter, i hope the event submitonenter is triggering, since it is htmlb tag.

if you use html tag then you can use javascript or ajax and do some thing to know about the value.