Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question about multiple buttons
Message
 
À
18/12/2004 02:54:20
Information générale
Forum:
Visual FoxPro
Catégorie:
ActiveVFP
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00970289
Message ID:
00970325
Vues:
14
The key is to check if the form variable is empty or not like:
IF ! EMPTY(oRequest.form('r1b2'))
    oResponse.Redirect(oProp.ScriptPath+[?action=r1b2routine])
ENDIF
This works for Submit buttons. You could also change to type Button in the HTML template and shoot off custom Javascript(that could execute AVFP methods) from each of the buttons.
I'm working on AVFP v.3 this weekend and next weekend in between other activities...
>Hi Claude
>
>I have a question about ActiveVFP.
>
>On a page I have a form with about 5 buttons - Butt1, butt2 etc.
>with name=button1, button2 etc and value = but1, but2 etc.
>
>All buttons are in the single form ":
>form method="POST" action=" <%=oProp.ScriptPath +[?action=buttonclicked] ">
>
>
><form method="POST" action="&lt;%=oProp.ScriptPath +[?action=buttonclicked]  ">
>  <div style="position: absolute; top: 48; left: 201; width: 505; height: 50; z-index:1">
>    <button name="r1b1" type="submit" style="width: 125; height: 22; font-family: Times New Roman; font-size: 10pt; font-style: italic; color: #A50400; background-color: #E7E7E7" value="but1">
>    Home</button>
>    <button name="r1b2" type="submit" style="width: 125; height: 22; font-family: Times New Roman; font-size: 10pt; font-style: italic; color: #A50400; background-color: #E7E7E7" value="but2">
>    About</button>
>    <button name="r1b3" type="submit" style="width: 125; height: 22; font-family: Times New Roman; font-size: 10pt; font-style: italic; color: #A50400; background-color: #E7E7E7" value="but3">
>    Wiki</button>
>    <button name="r1b4" type="submit" style="width: 125; height: 22; font-family: Times New Roman; font-size: 10pt; font-style: italic; color: #A50400; background-color: #E7E7E7" value="but4">
>    Documents</button>
>
>  </div>
></form>
>
>
>
>My question is :
>
>How to find out which button was clicked?
>
>On all your sample pages I find only single submit buttons and those pages with multiple buttons have separate forms for each submit button.
>
>Also I tried calling ?action=aspvars from the button and got an error!!
>
>I finally found this and fixed it by using TRANSFORM() for the following code in activevfp.prg:
>
>
>lcVar =   TRANSFORM(THIS.oRequest.FORM(lcFormVar))
>lcSTR=lcSTR+[<TR><TD><b> ]+ TRANSFORM(lcFormVar) +[ </b></TD><TD> ]+crlf;
>		+lcVar +[</TD></TR>]+crlf
>
>
>This fixed the error but does not tell me which button was clicked.
>
>Any help?
>
>Thanks
>
>Bernard.
>
>ps. Awaiting ActiveVFP3 for Win2003 testing.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform