NetTalk Central

Author Topic: how to chain to a net:webpage from a custom button?  (Read 5911 times)

Bram Klootwijk

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • Email
how to chain to a net:webpage from a custom button?
« on: July 30, 2007, 01:01:27 PM »
Hi,

i have a form and do'nt want to use the save button to chain to another page. Instead i have added a button without a URL and in the embed-point for server-side i've added several file-operations. After that i want to chain to a Net:webpage (without change/insert/delete or whatever, just a simple thankyou page).

How can i do that?

any help is welcome!

Cheers,
Bram

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: how to chain to a net:webpage from a custom button?
« Reply #1 on: July 31, 2007, 11:19:14 PM »
Hi Bram,

The second part of the question is the most important.

>> After that I want to chain to a Net:webpage

Remember the server can't "push" pages to the client. The client has to request them. The requests are either GET's or POSTS.

With that in mind, the Button _has_ to have a URL - the URL of the page you want to go to.

Since the Save button will do this, I reckon it's probably best to put that back.

If you want to embed code, triggered by the save button, then put it int he ValidateAll routine in the form.

cheers
Bruce



Alan Telford

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
Re: how to chain to a net:webpage from a custom button?
« Reply #2 on: August 01, 2007, 01:41:16 PM »
Ok so if I use the SAVE button, then I use the ValidateAll embed points. I understand.

What about if I'm using a regular button with a URL.
Is there an embed point that detects this button being pressed before it goes to the URL?

Alan

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: how to chain to a net:webpage from a custom button?
« Reply #3 on: August 02, 2007, 12:48:20 AM »
Hi Alan,

In 4.28 and before the answer is "no".

In 4.29 it's "not quite". In 4.29 if the button is marked as "Send new value to server" AND it has an URL, then both requests are triggered at the "same time". You can't rely on the button press arriving before the page request, although in most cases it almost certainly will. However remember that the server is multi-threaded, so you definitely can't rely on the button press being _handled_ before the page request.

One use for this is if you need to "count" the number of clicks on that button, even if the button points to the URL of another site.

Incidentally this approach can also be used (in 4.29 or later) for all "Display" Form fields, including images and URL links.

Clearly one use for this is Advertising - you're able to count the number of times a link, button or image, is clicked, without the target site needing to do anything on their side.

Another use for this is to track people "leaving" your site by clicking on an external link. Usually it's normal to open external links in another window (by setting the "target" of the link to '_blank') but you might prefer to link to the site in the same window AND do something internally (like log the user out).

Cheers
Bruce