NetTalk Central

Author Topic: Make an alert stay on the screen until OK clicked  (Read 4683 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Make an alert stay on the screen until OK clicked
« on: September 09, 2015, 01:16:38 AM »
I have a netwebPage called CheckAvailability on my webserver
A client has a website on which he has various hotspots.
Clicking a hotspot links him to a url www.mysite\CheckAvailability?stall=F01


If I don't find a matching record I redirect the user to the calling website.
   p_web.Script(  P_web.WindowOpen('http://www.callingsite.co.za.html') )

If I find a matching record with this value I pass the user through to my website index page where he can register and then login.
        p_web.Script('ntAlert("This Stall is still available.","Wonderful");')   
        p_web.Script(  P_web.WindowOpen('IndexPage') )

The internal logic works fine.
My problem
   This line only displays for a fraction of a second
   p_web.Script('ntAlert("This Stall is still available.","Wonderful");')   
I understand from what Kevin (MyBrainIsFull) said that it needed a page for the alert message to stay on the screen.
   What I would like to do then is when the menu displays if the sessionvariable that the stall number is stored in is not blank to display an alert message.
Something in the nature of:
If you have not visited the website before please register otherwise login with your assigned password.
which I would like to stay on the screen until the user clicks OK.
Where should I place this code to achieve this effect?
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Make an alert stay on the screen until OK clicked
« Reply #1 on: September 09, 2015, 02:55:00 PM »
I would try

p_web.Script(  P_web.WindowOpen('IndexPage') )

and then have a condition on your index page that runs

p_web.Script('ntAlert("This Stall is still available.","Wonderful");')

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Make an alert stay on the screen until OK clicked
« Reply #2 on: September 09, 2015, 08:50:10 PM »
Hi Kevin
Yes that's exactly what I want to do. I am not sure exactly where in the index page I want to place the message.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Make an alert stay on the screen until OK clicked
« Reply #3 on: September 09, 2015, 09:40:19 PM »
Hi Terry, its not going to break anything putting in various places <grin>  they are just alert messages

If you want it at the start when the form opens, look in the source for GenerateForm

then your alert will pop up when the form is created.

Let me know if you want it somewhere else.

K

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Make an alert stay on the screen until OK clicked
« Reply #4 on: September 09, 2015, 11:35:07 PM »
You're right. I just needed to decide if I wanted the message before the header or the body or the footer or afterwards.
I eventually placed it after he footer. I also needed an indicator which was cleared after the message displayed otherwise the message would display every time the index page was called.
Anyway. Everything working smoothly now.
A point (not important or needed but I was wondering)
I understand from what I have seen in javascript documentation that the characters \n would create a newline in text. Adding it the the text in the script has no effect, the 2 characters are not displayed but no new line either.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Make an alert stay on the screen until OK clicked
« Reply #5 on: September 11, 2015, 04:06:42 AM »
The message text you see is "html" not "javascript".
And in Html a "newline" is just ignored whitespace - it has no effect on output.
If you want a break rather use
<br/>


cheers
Bruce