Auto fill forms

W

woody22

Hi,

ive got an online system which allows people to enter info into
database about an absence request they have - at the same time thi
emails the person in charge of absences.

The form is setup now but to make it easier i want to alter the "Name
and "email" fields so they require no filling in ie - a staff member
name will be chosen from a drop down list (ive done this bit fine) an
then once this is done the relevant email for this person i
automatically placed in the email field. This bit i am struggling wit
- anyone any ideas how this can be done??

Thanks!

Woody :


-
woody2
 
T

Thomas A. Rowe

Not possible when using the FP Form Handler to have the form data sent to an email address the is
being supplied when the form is submitted.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
J

Jens Peter Karlsen[FP-MVP]

You could use an onchange that called a function that dependent on the
currently selected value of the dropdown inserted the correct values in
the fields.
Something like:
function mail(){
if (document.forms[0].dropdownname.value=="Tom Jones")
document.forms[0].emailfieldname.value="[email protected]";
else if ...
And so on.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.

-----Original Message-----
From: woody22 [mailto:[email protected]]
Posted At: 21. juli 2004 15:43
Posted To: microsoft.public.frontpage.client
Conversation: Auto fill forms
Subject: Auto fill forms



Hi,

ive got an online system which allows people to enter info into a
database about an absence request they have - at the same time this
emails the person in charge of absences.

The form is setup now but to make it easier i want to alter the "Name"
and "email" fields so they require no filling in ie - a staff members
name will be chosen from a drop down list (ive done this bit fine) and
then once this is done the relevant email for this person is
automatically placed in the email field. This bit i am struggling with
- anyone any ideas how this can be done??

Thanks!

Woody :)
 
W

woody22

thanks for that ill have a go today - where would i put the code fo
this though??

Woody :)
*You could use an onchange that called a function that dependent o
the
currently selected value of the dropdown inserted the correct value
in
the fields.
Something like:
function mail(){
if (document.forms[0].dropdownname.value=="Tom Jones")
document.forms[0].emailfieldname.value="[email protected]";
else if ...
And so on.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.

-----Original Message-----
From: woody22 [mailto:[email protected]]
Posted At: 21. juli 2004 15:43
Posted To: microsoft.public.frontpage.client
Conversation: Auto fill forms
Subject: Auto fill forms



Hi,

ive got an online system which allows people to enter info into a
database about an absence request they have - at the same time this
emails the person in charge of absences.

The form is setup now but to make it easier i want to alter th
"Name"
and "email" fields so they require no filling in ie - a staf
members
name will be chosen from a drop down list (ive done this bit fine
and
then once this is done the relevant email for this person is
automatically placed in the email field. This bit i am strugglin
with
- anyone any ideas how this can be done??

Thanks!

Woody :)


-
woody2
 
W

woody22

woody22 said:
*thanks for that ill have a go today - where would i put the code fo
this though??

Woody :) *

Ive come up with this:


Code
-------------------


function mail()
if firstname.value="Gary Rodgers"
then
emailfieldname.value="[email protected]";
else if
firstname.value="Paul Worsnop"
then
emailfieldname.value="[email protected]";
end if
end


%>


-------------------


but this makes the browsers come up with the following error message:


Code
-------------------


Microsoft VBScript compilation error '800a03f9'

Expected 'Then'

/AbsenceForm/Absence.asp, line 24

if firstname.value="Gary Rodgers"
---------------------------------^


-------------------


whats wrong with my code???

:) Wood


-
woody2
 
W

woody22

can anyone offer any advice?

:)
Ive come up with this:
Code
-------------------


function mail()
if firstname.value="Gary Rodgers"
then
emailfieldname.value="[email protected]";
else if
firstname.value="Paul Worsnop"
then
emailfieldname.value="[email protected]";
end if
end


%>

-------------------


but this makes the browsers come up with the following erro
message:
Code
-------------------


Microsoft VBScript compilation error '800a03f9'

Expected 'Then'

/AbsenceForm/Absence.asp, line 24

if firstname.value="Gary Rodgers"
---------------------------------^

-------------------


whats wrong with my code???

:) Woody [/B



-
woody2
 
T

Thomas A. Rowe

function mail()
if firstname.value="Gary Rodgers" then
emailfieldname.value="[email protected]";
elseif firstname.value="Paul Worsnop" then
emailfieldname.value="[email protected]";
end if
end
%>

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================


woody22 said:
can anyone offer any advice?

:)
Ive come up with this:
Code:
--------------------


function mail()
if firstname.value="Gary Rodgers"
then
emailfieldname.value="[email protected]";
else if
firstname.value="Paul Worsnop"
then
emailfieldname.value="[email protected]";
end if
end


%>

--------------------


but this makes the browsers come up with the following error
message:
Code:
--------------------


Microsoft VBScript compilation error '800a03f9'

Expected 'Then'

/AbsenceForm/Absence.asp, line 24

if firstname.value="Gary Rodgers"
---------------------------------^

--------------------


whats wrong with my code???

:) Woody
 
J

Jens Peter Karlsen [FP MVP]

= is an assignment operator. == compares.
So it must be:
function mail()
if firstname.value=="Gary Rodgers" then
emailfieldname.value="[email protected]";
elseif firstname.value=="Paul Worsnop" then
emailfieldname.value="[email protected]";

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 
Top