Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I place a user at end of TextArea
Message
Information générale
Forum:
Internet
Catégorie:
HTML
Divers
Thread ID:
00966163
Message ID:
00966649
Vues:
8
This message has been marked as the solution to the initial question of the thread.
Hi Bret

Simply add folling statement after you set the focus to the textarea:

document.ProcurementModRemarksForm.PrcProcRem.value = document.ProcurementModRemarksForm.PrcProcRem.value + "";

That should do the trick.

HTH
Bruno

>Your code looks no different than what I am doing now with:
>document.ProcurementModRemarksForm.PrcProcRem.focus();
>
>This successfully sets the focus on the field on want, but my question is setting focus on the field and positioning the user at the end of the text area or the end of an input field. Will your code do this or just set focus on the field, which I already know how to do?
>
>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform