I have used events for the drop-down list that call a functions which updates the 
<input> fields with document.all.fieldname.innerText = value.

Here are some of my snippets:

-- The <SELECT> Definition
<SELECT NAME="Course" SIZE="1" onclick="Redbook(document.Req.Course.value)" 
onchange="Redbook(document.Req.Course.value)" 
onblur="CkRed(document.Req.Course.value)">
        <@ASSIGN NAME="r_temp1" VALUE="@@domain$vCourses" SCOPE="REQUEST">
        <@ROWS ARRAY="vDepartments" SCOPE="DOMAIN">
                <@ASSIGN NAME="r_temp1" VALUE="<@FILTER ARRAY='vCourses' 
SCOPE='DOMAIN' EXPR='#3=<@COL 1>'>" SCOPE="REQUEST">
                        <OPTION style="color: blue; font-weight:bold;" 
VALUE="NOGOOD">--<@COL 2>--</OPTION>
                                <@ROWS ARRAY="r_temp1" SCOPE="REQUEST">
                                        <OPTION VALUE="<@COL 
1>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<@COL 2></OPTION>
                                </@ROWS>
                        <OPTION VALUE="NOGOOD">&nbsp;</OPTION>
                <@ASSIGN NAME="r_temp1" VALUE="@@domain$vCourses" SCOPE="REQUEST">
        </@ROWS>
</SELECT>

-- The Functions
        function Redbook(crsecd)
        {
                if (crsecd == 'NOGOOD')
                {
                        document.all.Rbook.innerText = ' ';
                }
                else
                {
                        document.all.Rbook.innerText = crsecd;
                }
                        
        }
        
        function CkRed(ckr)
        {
                if (ckr == 'NOGOOD')
                {
                        alert('Invalid Selection.\n\nPlease choose again.');
                        document.Req.Course.focus();
                }
        }

--The <INPUT> Field
<INPUT TYPE="TEXT" NAME="Rbook" SIZE="10" READONLY>

This is the simplest way I know how.

Mike

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 21, 2004 7:04 AM
To: [EMAIL PROTECTED]
Subject: Witango-Talk: Searching (OT)


I have a client that wishes to automate a form for their employees. 
In essence, when the form is filled out, they want a drop down menu 
that they can use that autofills the address and possibly phone 
numbers into text boxes. They only have 6 addresses. The components 
of the address need to populate the different input text boxes.

Eaxample

(select list)
Location A
Location B
Location C

(autofills location)
(A)
1234 West Fern           <input type=text>
Chicago          <input type=text>
Il               <input type=text>
55555            <input type=text>

(B)
5498 East Clover         <input type=text>
New York                 <input type=text>
NY               <input type=text>
44444            <input type=text>



I saw this once on a site that used javascript to autofill the form 
but cannot find the site. Nor can I find any examples of this after 
an exhaustive search.  I was wondering if any of you javascript gurus 
could help me out or point me in the right direction.

Thanks
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to