PDA

View Full Version : Which button was that again?


Bruce
04-10-2006, 12:31 PM
Ok here's what I have...


Global-

function WhatButton2(ButtonName)
if ButtonName == "tan_cert_Button" then
sbutton = "tan"

elseif ButtonName2 == "salon_sales_Button" then
sbutton = "sales"

elseif ButtonName2 == "skin_care_Button" then
sbutton = "skin"

elseif ButtonName2 == "spray_on_Button" then
sbutton = "spray"

elseif ButtonName2 == "first_impressions_Button" then
sbutton = "first"

end
end


Now, on the next page I have five buttons. On each button I have:

WhatButton2(this);
Page.Jump("paypal");

This then jumps to another page that displays an .html, at the botton of of this page there is a button that has this code:

if sbutton == "tan" then
Page.Jump("tan reg");

elseif sbutton == "sales" then
Page.Jump("sales reg");

elseif sbutton == "skin" then
Page.Jump("skin reg");

elseif sbutton == "spray" then
Page.Jump("spray reg");

elseif sbutton == "first" then
Page.Jump("first reg");

end


The first one works (if sbutton == "tan" then
Page.Jump("tan reg");) but none of the others will, any ideas? BTW I do not have Quick Actions on any of the buttons. (thanks Tigg)

Roboblue
04-10-2006, 12:48 PM
Have you tried turning on your debug display and see what is not firing correctly?
It's in the edit-preferences-build section.

azmanar
04-10-2006, 01:07 PM
Bruce,

Did u noticed that in ur Global, u did not end each variable assignment with a ";"?

playmenow
04-10-2006, 01:09 PM
Or use Debug.ShowWindow(true) & set false to close it. I can't see any error in your code...
EDIT: Ahh...here's your problem. You are calling another string. Remove the digit '2' and it works fine:


function WhatButton2(ButtonName)
if ButtonName == "tan_cert_Button" then
sbutton = "tan"

elseif ButtonName == "salon_sales_Button" then
sbutton = "sales"

elseif ButtonName == "skin_care_Button" then
sbutton = "skin"

elseif ButtonName == "spray_on_Button" then
sbutton = "spray"

elseif ButtonName == "first_impressions_Button" then
sbutton = "first"

end
end



Did u noticed that in ur Global, u did not end each variable assignment with a ";"?


I don't think it's needed. It works for me withut the ";" ;)

Bruce
04-10-2006, 03:22 PM
Or use Debug.ShowWindow(true) & set false to close it. I can't see any error in your code...
EDIT: Ahh...here's your problem. You are calling another string. Remove the digit '2' and it works fine:


function WhatButton2(ButtonName)
if ButtonName == "tan_cert_Button" then
sbutton = "tan"

elseif ButtonName == "salon_sales_Button" then
sbutton = "sales"

elseif ButtonName == "skin_care_Button" then
sbutton = "skin"

elseif ButtonName == "spray_on_Button" then
sbutton = "spray"

elseif ButtonName == "first_impressions_Button" then
sbutton = "first"

end
end




I don't think it's needed. It works for me withut the ";" ;)


Well...This is also in the global, first.

function WhatButton(ButtonName)
if ButtonName == "tan_cert_Button" then

sURL = "AutoPlay\\Docs\\pay_basic.html"

elseif ButtonName == "salon_sales_Button" then

sURL = "AutoPlay\\Docs\\pay_sales.html"

elseif ButtonName == "skin_care_Button" then

sURL = "AutoPlay\\Docs\\pay_skin.html"

elseif ButtonName == "spray_on_Button" then

sURL = "AutoPlay\\Docs\\pay_spray.html"

elseif ButtonName == "first_impressions_Button" then

sURL = "AutoPlay\\Docs\\pay_first.html"

end
end

Bruce
04-10-2006, 11:08 PM
This seems to be a dead thread...
Maybe I have two functions that are causing each other some grief... Lets try this again with all the info.


Global:

function WhatButton(ButtonName)
if ButtonName == "tan_cert_Button" then

sURL = "AutoPlay\\Docs\\pay_basic.html"

elseif ButtonName == "salon_sales_Button" then

sURL = "AutoPlay\\Docs\\pay_sales.html"

elseif ButtonName == "skin_care_Button" then

sURL = "AutoPlay\\Docs\\pay_skin.html"

elseif ButtonName == "spray_on_Button" then

sURL = "AutoPlay\\Docs\\pay_spray.html"

elseif ButtonName == "first_impressions_Button" then

sURL = "AutoPlay\\Docs\\pay_first.html"

end
end


--================================================== =======


function WhatButton2(ButtonName)
if ButtonName == "tan_cert_Button" then
sbutton = "tan"

elseif ButtonName2 == "salon_sales_Button" then
sbutton = "sales"

elseif ButtonName2 == "skin_care_Button" then
sbutton = "skin"

elseif ButtonName2 == "spray_on_Button" then
sbutton = "spray"

elseif ButtonName2 == "first_impressions_Button" then
sbutton = "first"

end
end

What each button has in it:

WhatButton(this);
WhatButton2(this);
Page.Jump("paypal");

On "paypal" page:

if not sURL then
sURL = "about:blank"
end
Web.LoadURL("Web1", sURL)


What's in the continue button on the same page:

if sbutton == "tan" then
Page.Jump("tan reg");
elseif sbutton == "sales" then
Page.Jump("sales reg");
elseif sbutton == "skin" then
Page.Jump("skin reg");
elseif sbutton == "spray" then
Page.Jump("spray reg");
elseif sbutton == "first" then
Page.Jump("first reg");
end

This is sucking wind :rolleyes

playmenow
04-10-2006, 11:56 PM
Yes, and all I see wrong is here:

function WhatButton2(ButtonName)
if ButtonName == "tan_cert_Button" then
sbutton = "tan"

elseif ButtonName2 == "salon_sales_Button" then
sbutton = "sales"

elseif ButtonName2 == "skin_care_Button" then
sbutton = "skin"

elseif ButtonName2 == "spray_on_Button" then
sbutton = "spray"

elseif ButtonName2 == "first_impressions_Button" then
sbutton = "first"

end
end

You could add the digit '2' at the end os the string at it should work fine.

Bruce
04-11-2006, 12:34 AM
Got it! Thanks to everyone :D I'll show you what I did later, I gotta get some sleep!