Hello Woody,
Like wbmstr2good stated, the Then has to be on the same line as the If. Also note that Else If in vbscript is one word, you do not end the line with ; and you must end the function with End Function. So your code should look like this...
Code:
<%
function mail()
if firstname.value="Gary Rodgers" then
emailfieldname.value="grodgers@wickersley.net"
elseif firstname.value="Paul Worsnop" then
emailfieldname.value="pworsnop@wickersley.net"
end if
end function
%>
This is all assuming that you are trying to run the code on the server and not the browser. Seeing things such as firstname.value makes me feel you are trying to either run this on the browser (for which you should use javascript and therefore my code above is all wrong) or you are hoping that firstname.value on the server will set that value on the form, but it doesn't work that way.
I hope that makes some sense  .
|