View Full Version : html triggers Screen.Next()
Boy.. here is a good one. On my scrolling html screen I have the Next button visible but not enabled. How can I enable the next button with html or my php script?
Carter
Desmond
09-16-2005, 03:52 PM
Hello,
I'd do something like this:
1. Place the following code onto the On Ctrl Message event of your scrolling html screen:
-- These actions are triggered by the controls on the screen.
if e_MsgID == MSGID_ONNAVIGATE then
sPoundLocation = String.Find(e_Details.URL, "#", 1, false);
Dialog.Message("sPoundLocation", sPoundLocation);
if sPoundLocation ~= -1 then
sAnchor = String.Right(e_Details.URL, sPoundLocation - 1);
Dialog.Message("sAnchor", sAnchor);
if sAnchor == "enable_next" then
DlgButton.SetProperties(CTRL_BUTTON_NEXT, {Enabled=true});
end
end
end
2. Use the following HTML code:
<a href="#enable_next">enable</a>
Now, this does have the 'bad' effect of loading up an 'empty' html page (do it in an empty project, you'll see what i mean). But you can get around this by adding a path to your html file before the '#' in that link.
Give it a try, let me know how it works for you.
Yes, that works... But lets say that my html scrolling screen is my html registration form page. At the bottom of that html form is the submit button (reason that the next button is not enabled). So the user fills out the registration page and hits submit. My php script does what it needs to do and reloads with the php echo results. How can I trigger the enabling of the next button once the page reloads? Can I have the Next button submit the form and and its variables to the script from that html screen?
can I ad the #enable_next to the end of the reloaded html page?
bnkrazy
09-16-2005, 10:12 PM
I have never used a scrolling html screen before, but I wonder if the
if e_MsgID == MSGID_ONNAVIGATE then
construct would let you catch a meta refresh as well as a link nav...
If so, your script could return the results as well as a meta refresh of 5 seconds or so, then redirect to a 'Click Next to continue' page that simply enables the next button instructs the user to click it to continue...the string.find would then search for the above string or a special comment on the html page...either would work.
That would also allow you to return a different response (without the meta refresh to the 'continue' page) if the user's data didn't validate and needed to be modified.
Desmond
09-19-2005, 09:21 AM
Step 1: Your users will register through the scrolling HTML screen.
After that, try having your script jump to another page if successful. I think you can do that by adjusting the URL in the headers section of your HTML (php) page.
Then, use the technique above to capture the URL being browsed to, and if it matches the successful URL, enable the next button (or just do a Screen.Next action, and save the user a click).
Yes, that works... But lets say that my html scrolling screen is my html registration form page. At the bottom of that html form is the submit button (reason that the next button is not enabled). So the user fills out the registration page and hits submit. My php script does what it needs to do and reloads with the php echo results. How can I trigger the enabling of the next button once the page reloads? Can I have the Next button submit the form and and its variables to the script from that html screen?
Well, I got it working but under a very simplistic approach. What i did was attach to code Desmond so graciously supplied to my actually registration html page. When the user gets his registration confirmation (php generated) page, the user click the "NEXT" button in the html. it links to the #next_enable, like the example supplied. Instead of enabling the next button. I just send the installer to the Screen.Next(). works like a charm. Thanks again.
Carter
bnkrazy
09-19-2005, 07:05 PM
The simpler the better! And saves the user a click as well. :yes
Desmond
09-20-2005, 09:39 AM
Glad you got it working!
Desmond.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.