Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HTML form - 2 submit buttons?
Message
De
01/07/2014 13:14:16
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01602997
Message ID:
01603004
Vues:
70
This message has been marked as the solution to the initial question of the thread.
J'aime (1)
>Hi everybody,
>
>We have a VFP application right now that produces HTML file displayed in a C++ application.
>
>This is what I have in the HTML right now (made changes yesterday and hadn't have a chance to test today yet)
>
>
><FORM METHOD="post" ACTION="rez://SEARCH" ID="frmAddItem" NAME="frmAddItem">
><#IF llSigCapture>
>                  <OBJECT classid=clsid:69A40DA3-4D42-11D0-86B0-0000C025864A height=0 id=SigPlus1 name=SigPlus1
>		                   style="HEIGHT: 0px; WIDTH: 0px; LEFT: 0px; TOP: 0px; VIEWASTEXT; visibility: hidden">
>                         <PARAM NAME="_Version" VALUE="131095">
>                         <PARAM NAME="_ExtentX" VALUE="4842">
>                         <PARAM NAME="_ExtentY" VALUE="1323">
>                         <PARAM NAME="_StockProps" VALUE="0"></OBJECT><BR><BR>
><#ENDIF>
><INPUT TYPE="hidden" NAME="SessionInfo" VALUE="<<This.cSessionInfo>>">
><INPUT TYPE="text"   NAME="txtSearch" ID="txtSearch" VALUE="" SIZE="10" CLASS="formtext">&nbsp;&nbsp;
><SELECT NAME="cboSearchOption">
>                <LOOP Table=csrSearchOptions><OPTION <<IIF(csrSearchOptions.Option = "All Fields", [SELECTED], [])>> VALUE="<<ALLTRIM(csrSearchOptions.Option)>>"><<ALLTRIM(csrSearchOptions.Option)>></Option></LOOP>
></SELECT>
>
><INPUT TYPE="submit" CLASS='button' VALUE="Search" TITLE = "Partial Match Search by Selected Field">
>
><INPUT TYPE="submit" CLASS='button'
>     ONCLICK="navigate('REZ://ExactMatch')"
>	 TITLE = "Exact Match Search by Selected Field"
>     VALUE="Exact Match" ID="btnExactMatch">
>
></FORM><BR>
>
>There are two problems so far.
>
>1. I added an ExactMatch button and I want it to behave the same way as Search button. So, I need to be able to read txtSearch and cboSearchOptions values back in the procedure that performs the action. I also want to be able to tell if the action was initiated by a Search button or by Exact Match button.
>
>So, this is my first problem - I don't know if this is OK to have 2 submit buttons or not and if not, how else should I pass the txtSearch and cboSearchOptions values back?

It's fine to have two submit buttons, but not a good idea to wire one of them up to an 'onclick'. I'd wire both up to a javascript method passing the id as a parameter, set an hidden field as Craig suggests, then do 'document.form.submit()'

>
>2. My other little problem is display. I want the Exact Match button to be right below the Search button in my HTML. I am not sure how to get this too.

BR ? :-}

>Thanks a lot in advance.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform