NetTalk Central

Author Topic: Close NT 10.15 browse with conditional code?  (Read 4065 times)

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Close NT 10.15 browse with conditional code?
« on: February 18, 2018, 11:31:08 AM »
I have a need to close a browse, shortly after opening, based on a condition.  I want to display a message and then when the user closes the message, have the browse close automatically.

I have experimented with the following in the generate browse embed:

   p_web.Script('$(''[data-do="cancel"]'').click();')

        p_web.Script('alert("Please enter the Pre-Results First!");')

The code to generate the message works, but the browse is not closed.  Is this going to work or can someone suggest a better way?

Thanks,

Jeff

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Close NT 10.15 browse with conditional code?
« Reply #1 on: February 18, 2018, 10:55:20 PM »
Hi Jeff,

First, I think your logic is backwards.

>> I have a need to close a browse, shortly after opening, based on a
>> condition.

why go to the browse at all? why mislead the user into thinking something is
possible, then tell them it's not?

>>  I want to display a message and then when the user closes the message,
>> have the browse close automatically.

I'm not 100% sure I'm a fan of this approach, but try doing the Alert line
first.

cheers
Bruce