Ask a Question related to Macromedia ColdFusion, Design and Development.
-
Steve Grosz #1
Setting focus on a form field
When a CFM page loads, how can you set focus on a textbox so the cursor
is already in the field?
Thanks
Steve
Steve Grosz Guest
-
ASP - setting form field to insert memo
Hi all. I am using DW's Insert Record behavior in an effort to create a form to insert a record into a MS Access database. Everything works fine -... -
Setting hidden field value eq to a form field value.
Ok guys help a dumb blond out. I need to pass the value of a form field to two different file fields. Here is an example of what I have; <form... -
Setting Input Focus for a Field
Hello, I've been programming in Lingo for over 5 years and have noticed over the years that people often want to know how to programmatically... -
Setting Focus on field when RequiredFieldValidator fails - This Works!
There seems to be way too much confusion over how to set focus on the a field using a field validator. I looked all over the web and found people... -
Setting focus after Validating Form Items
I have a form with about 5 or 8 textboxes and all of them have required field validators... When I submit the form, if some of this field are... -
JMGibson3 #2
Re: Setting focus on a form field
<cfoutput><body onload="document.forms.#varFormFocus#.focus();"></cfoutput>
where varFormFocus has been set to your form field name (case sensitive, must
exactly match Form).
For field types that can handle it (i.e. straight, not lists) substitute
..select() for highligthed overtyping.
JMGibson3 Guest
-
Kronin555 #3
Re: Setting focus on a form field
This has nothing to do with cfm pages, it's a general HTML form question.
You set focus via Javascript. document.formname.fieldname.focus();
Kronin555 Guest
-
Steve Grosz #4
Re: Setting focus on a form field
So if my search form is search.cfm, would it be:
document.search.searchstring.focus();
??
Steve
Kronin555 wrote:> This has nothing to do with cfm pages, it's a general HTML form question.
>
> You set focus via Javascript. document.formname.fieldname.focus();Steve Grosz Guest
-
paross1 #5
Re: Setting focus on a form field
It would be the value of the NAME parameter of your FORM or CFFORM tag in your
template, and the name given the INPUT tag.
Something like
body onload="document.form_name.input_name.focus()">
<cfform name="form_name" action="whatever.cfm" method="POST" target="_top">
<input type="text" name="input_name" required="yes" message="whatever">
Phil
paross1 Guest



Reply With Quote

