Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I place a user at end of TextArea
Message
From
03/12/2004 04:46:56
 
General information
Forum:
Internet
Category:
HTML
Miscellaneous
Thread ID:
00966163
Message ID:
00966624
Views:
7
>I have created a form called Form1 that has a TextArea called TextArea1. The TextArea displays a large memo field for the user to edit or add to. What I need is the ability to place the user at the end of the text data when the HTML form comes up. Does anyone know how that can be accomplished for a Web Form? Also as a side question when I have an Input field called Input1 and it initially has a value of ADL666. I would like to place the user on the Input1 field and at the end of the last 6, so they can just append to it when the form comes up.
>
>Any help on either of these would be greatly appreciated.
>
>TIA

Bret,

I'm assuming that you can use JavaScript....no?

In the BODY tag, do this:
onLoad="SetFocus(xForm,zField);"
xForm is the OCCURANCE NUMBER of the Form (first form on the page is 1, second form on the page is 2, etc.)
zField is the TextArea zOrder you want to set focus to: if it's the 4th control on the page, it equals 4.

Typically it looks like this:
<BODY onLoad="SetFocus(1,4);" >
ie sets focus to the fourth field of the first form on the page.

REMEMBER: JavaScript is case sensitive. setFocus and Setfocus won't work unless you rename the function accordingly.

Place the following function in the HEAD.../HEAD tag section of the document or in a JavaScript procedure file:
<SCRIPT language="JavaScript" type="text/JavaScript">
<!--
function SetFocus(fInst, eInst) {
fInst=fInst-1;  // the passed form number
eInst=eInst-1;  // the passed field number
  if (document.forms.length > 0) 
  {
   document.forms[fInst].elements[eInst].focus();
  }
 }
//-->
</SCRIPT>
David
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform