RE: Witango-Talk: Searching (OT)

2004-07-21 Thread Willochell, Mike
I have used events for the drop-down list that call a functions which updates the 
 fields with document.all.fieldname.innerText = value.

Here are some of my snippets:

-- The  Definition

<@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">
--<@COL 2>--
<@ROWS ARRAY="r_temp1" SCOPE="REQUEST">
 <@COL 2>

 
<@ASSIGN NAME="r_temp1" VALUE="@@domain$vCourses" SCOPE="REQUEST">



-- 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  Field


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   
Chicago  
Il   
5

(B)
5498 East Clover 
New York 
NY   
4



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


RE: Witango-Talk: Searching (OT)

2004-07-21 Thread webdude
Sorry, I was hoping for something in pure javascript.
I have used events for the drop-down list that call a functions 
which updates the  fields with 
document.all.fieldname.innerText = value.

Here are some of my snippets:
-- The  Definition

	<@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">
			--<@COL 2>--
<@ROWS ARRAY="r_temp1" SCOPE="REQUEST">
	 <@COL 2>

			 
		<@ASSIGN NAME="r_temp1" VALUE="@@domain$vCourses" 
SCOPE="REQUEST">
	


-- 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  Field

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   
Chicago  
Il   
5
(B)
5498 East Clover 
New York 
NY   
4

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

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


RE: Witango-Talk: Searching (OT)

2004-07-21 Thread Willochell, Mike
Like?

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


Sorry, I was hoping for something in pure javascript.

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


RE: Witango-Talk: Searching (OT)

2004-07-21 Thread webdude
I have been putzing with this and got it to work, cross platform. Not 
done yet, but it works so far. Any suggestion are welcome...



Select One
Eagandale
Eagandale Tech Center
Main Building
River Park
River Park II
Waterview


Address 


City
   



State
   



Zip
   



 












  




</pre><br>
<pre style="margin: 0em;"><br><!--
comp_name1 = new Array()
comp_name2 = new Array()
comp_name3 = new Array()
comp_addr1 = new Array()
comp_addr2 = new Array()
comp_addr3 = new Array()
comp_city = new Array()
comp_state = new Array()
comp_zip = new Array()</pre><br>
<pre style="margin: 0em;"><br></pre><br>
<pre style="margin: 0em;">comp_name1[0]=""
comp_name2[0]=""
comp_name3[0]=""
comp_addr1[0]=""
comp_addr2[0]=""
comp_addr3[0]=""
comp_city[0]=""
comp_state[0]=""
comp_zip[0]=""
comp_name1[1]=""
comp_name2[1]=""
comp_name3[1]=""
comp_addr1[1]="1305 Corporate Center Drive"
comp_addr2[1]=""
comp_addr3[1]=""
comp_city[1]="New York"
comp_state[1]="MN"
comp_zip[1]="5-1204"
comp_name1[2]=""
comp_name2[2]=""
comp_name3[2]=""
comp_addr1[2]="1303 Corporate Center Drive"
comp_addr2[2]=""
comp_addr3[2]=""
comp_city[2]="Chicago"
comp_state[2]="MN"
comp_zip[2]="6-1204"
comp_name1[3]=""
comp_name2[3]=""
comp_name3[3]=""
comp_addr1[3]="3535 Blue Cross Road"
comp_addr2[3]=""
comp_addr3[3]=""
comp_city[3]="Minneapolis"
comp_state[3]="MN"
comp_zip[3]="7-1154"
comp_name1[4]=""
comp_name2[4]=""
comp_name3[4]=""
comp_addr1[4]="3400 Yankee Drive"
comp_addr2[4]=""
comp_addr3[4]=""
comp_city[4]="Los Angles"
comp_state[4]="MN"
comp_zip[4]="8-1627"
comp_name1[5]=""
comp_name2[5]=""
comp_name3[5]=""
comp_addr1[5]="1800 Yankee Doodle Road"
comp_addr2[5]=""
comp_addr3[5]=""
comp_city[5]="San Fra"
comp_state[5]="MN"
comp_zip[5]="9-1644"
comp_name1[6]=""
comp_name2[6]=""
comp_name3[6]=""
comp_addr1[6]="1200 Yankee Doodle Road"
comp_addr2[6]=""
comp_addr3[6]=""
comp_city[6]="Detroit"
comp_state[6]="MN"
comp_zip[6]="2-2202"</pre><br>
<pre style="margin: 0em;">var f = document.form1</pre><br>
<pre style="margin: 0em;">function FillInAddress(str1) {
if (f.AddressID.options[f.AddressID.selectedIndex].value == 0) {
f.comp_name1.value = ""
f.comp_name2.value = ""
f.comp_name3.value = ""
f.comp_addr1.value = ""
f.comp_addr2.value = ""
f.comp_addr3.value = ""
f.comp_city.value = ""
f.comp_state.value = ""
f.comp_zip.value = ""
        f.phone.value = ""
f.fax.value = ""
 }
else {
f.comp_name1.value = comp_name1[str1]
f.comp_name2.value = comp_name2[str1]
f.comp_name3.value = comp_name3[str1]
f.comp_addr1.value = comp_addr1[str1]
f.comp_addr2.value = comp_addr2[str1]
f.comp_addr3.value = comp_addr3[str1]
f.comp_city.value = comp_city[str1]
f.comp_state.value = comp_state[str1]
f.comp_zip.value = comp_zip[str1]</pre><br>
<pre style="margin: 0em;">}
}</pre><br>
<pre style="margin: 0em;">//--></pre><br>
<pre style="margin: 0em;"><br>
Like?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 21, 2004 8:29 AM
To: [EMAIL PROTECTED]
Subject: RE: Witango-Talk: Searching (OT)
Sorry, I was hoping for something in pure javascript.

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

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


RE: Witango-Talk: Searching (OT)

2004-07-21 Thread Willochell, Mike


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 21, 2004 12:07 PM
To: [EMAIL PROTECTED]
Subject: RE: Witango-Talk: Searching (OT)

>>>
I have been putzing with this and got it to work, cross platform. Not 
done yet, but it works so far. Any suggestion are welcome...
<<<

The only think I would have done different is to use the case statement for efficiency 
and organization [see below].

Mike




Select One
Eagandale
Eagandale Tech Center
Main Building
River Park
River Park II
Waterview


Address 



City



State



Zip















   




<!--
var f = document.form1

function FillInAddress(str1) 
{
switch(str1)
{
case '0':
{
f.comp_name1.value = "";
f.comp_name2.value = "";
f.comp_name3.value = "";
f.comp_addr1.value = "";
f.comp_addr2.value = "";
f.comp_addr3.value = "";
f.comp_city.value = "";
f.comp_state.value = "";
f.comp_zip.value = "";
f.phone.value = "";
f.fax.value = "";
break;
}
case '1':
{
f.comp_name1.value = "";
f.comp_name2.value = "";
f.comp_name3.value = "";
f.comp_addr1.value = "1305 Corporate Center Drive";
f.comp_addr2.value = "";
f.comp_addr3.value = "";
f.comp_city.value = "New York";
f.comp_state.value = "MN";
f.comp_zip.value = "5-1204";
break;
}
case '2':
{
f.comp_name1.value = "";
f.comp_name2.value = "";
f.comp_name3.value = "";
f.comp_addr1.value = "1303 Corporate Center Drive";
f.comp_addr2.value = "";
f.comp_addr3.value = "";
f.comp_city.value = "Chicago";
f.comp_state.value = "MN";
f.comp_zip.value = "6-1204";
break;
}
case '3':
{
f.comp_name1.value = "";
f.comp_name2.value = "";
f.comp_name3.value = "";
f.comp_addr1.value = "3535 Blue Cross Road";
f.comp_addr2.value = "";
f.comp_addr3.value = "";
f.comp_city.value = "Minneapolis";
f.comp_state.value = "MN";
f.comp_zip.value = "7-1154";
break;
}
case '4':
{
f.comp_name1.value = "";
f.comp_name2.value = "";
f.comp_name3.value = "";
f.comp_addr1.value = "3400 Yankee Drive";
f.comp_addr2.value = "";
f.comp_addr3.value = "";
f.comp_city.value = "Los Angeles";
f.comp_state.value = "MN";
f.comp_zip.value = "8-1627";
break;
}
case '5':
{
f.comp_name1.value = "";
f.comp_name2.value = "";
f.comp_name3.value = "";
f.comp_addr1.value = "1800 Yankee Doodle Road";
f.comp_addr2.value = "";
f.comp_addr3.value = "";
f.comp_city.value = "San Fra";
f.comp_state.value = "MN";
f.comp_zip.value = "9-1644";
break;
}
case '6':
{