Copy link to clipboard
Copied
Hi everyone,
I have been searching for a while without success so would like to ask if anyone can help me here.
I have a login page with jusy username and password text fields and a login button.
I would liek users to be able to hit the enter key to activate the login process.
My code currently is
<cfformgroup type="panel" label="Development Area" height="130" style="cornerRadius: 0;">
<cfinput type="text" name="username" width="150" label="Username">
<cfinput type="password" name="password" width="150" label="Password">
<cfformgroup type="horizontal">
<cfinput type="submit" name="login_user" height="22" width="150" value="Log In" style="#buttonStyle#">
</cfformgroup>
</cfformgroup>
</cfformgroup>
This works fine but only if the user uses the mouse to click the login button.
I think it is maybe something to do with "if key is 13 then do sonmething" but I can't seem to get the code right
Anyideas please??
Thanks in advance
Copy link to clipboard
Copied
make it an html form.
Copy link to clipboard
Copied
Don't suppose you have an example to share - sorry - am very new to all this and am really trying by myself but struggling....suppose we all start somewhere
Copy link to clipboard
Copied
<form action="somewhere" method="post">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit" value="Keep it Simple">
Copy link to clipboard
Copied
Plz Try this..
<cfform
>
<cfformgroup type="panel" label="Development Area" height="130" style="cornerRadius: 0;">
<cfinput type="text" name="username" width="150" label="Username">
<cfinput type="password" name="password" width="150" label="Password">
<cfformgroup type="horizontal">
<cfinput type="submit" name="login_user" height="22" width="150" value="Log In" style="#buttonStyle#"></cfformgroup>
</cfformgroup>
</cfform>
<cfif
Isdefined("login_user")>
<cfdump var="Do your action here">