Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Several submit buttons in HTML page
Message
De
02/06/2015 16:53:37
 
 
Information générale
Forum:
HTML5
Catégorie:
HTML
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01620499
Message ID:
01620539
Vues:
52
This message has been marked as the solution to the initial question of the thread.
>Can you show some related code? I think this may be an approach we can take.
>
>Say, this is part of the current HTML:
>
>
><INPUT TYPE="hidden" NAME="txtAuthAction" ID="txtAuthAction" VALUE="RemoveOverdue">
><INPUT TYPE="hidden" NAME="txtAuthScan"   ID="txtAuthScan"   VALUE="<<This.cAuthItem>>">
><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=90% align=right>
><TR><TD WIDTH=25%> </TD>
><TD WIDTH=25%> </TD>
><TD WIDTH=20% ALIGN=right
> STYLE='font-size:10.0pt;font-family:Arial'>Password: </TD>
>  <TD><INPUT TYPE="PASSWORD" NAME="txtRemoveOverduePWD" ID="txtRemoveOverduePWD" WIDTH=30></TD>
>  <TD ALIGN=left><INPUT NAME="btnRemoveOverdue" CLASS='button' ID="btnRemoveOverdue" TYPE="submit" VALUE="Remove Overdue"></TD>
></TR></TABLE><BR/><BR/>
>
>So, when we enter password in that password textbox and hit Enter key, the button should fire and submit the form.

Here is an example:
<input name="Title_S" type="text" maxlength="40" id="Title_S" onkeypress="FormKeyPress(event)" style="width:300px;" />
Then, in the FormKeyPress() function, you may have something like this:
function FormKeyPress(toEvent)
{
   if (window.event)
   {
      lnKey=window.event.keyCode
   }
   else
   {
      if (toEvent)
      {
         if (toEvent.keyCode)
         {
            lnKey=toEvent.keyCode
         }
         else
         {
            lnKey=toEvent.charCode
         }
      }
      else
      {
      }
   }
   if (lnKey==13)
   {
      document.getElementById("Form1").submit()
      if (window.event)
      {
         window.event.keyCode=0
      }
      else
      {
         if (toEvent)
         {
            if (toEvent.keyCode)
            {
               toEvent.keyCode=0
            }
            else
            {
               toEvent.charCode=0
            }
         }
         else
         {
         }
      }
      if (window.event)
      {
         event.returnValue=false
      }
      else
      {
         toEvent.preventDefault()
      }
   }

}

// Enable support for Mozilla
if (document.layers)
{
   document.captureEvents(Event.KEYPRESS)
}
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform