Funky input methods...

M

Me

Any of you guys got a clue of how to assign a value from one input
box to another hidden input? What I'm trying to do is take inputs for
names on a registration page. You've got first, middle, last, and maiden
name inputs, but in the database you've got first, middle, last, maiden,
and displayed last name columns. The object is to have the page sample
the maiden name input and if there's anything in that input text box, it
should write that value to the displayed last name column, and if it's
empty it should write value of the last name input text box to the
displayed last name column. The object is to have "Melissa Porker" who
we all knew and loved in high school as "Melissa Petite" (now married to
Piggly Porker) to display as "Melissa Petite" on the web site so all of
her classmates will recognize her name (even if they don't recognize her
picture :) ), while displaying "Melissa Ethridge" as "Melissa
Ethridge" cuz she never got married. I've tried the following route but
it refuses to work:

<table>
<tr>
<td>Last Name</td><td><input type="text" name="LastName"></td>
</tr>
<tr>
<td>First Name</td><td><input type="text" name="FirstName"></td>
</tr>
<tr>
<td>Middle Name</td><td><input type="text" name="MiddleName"></td>
</tr>
<tr>
<td>Maiden Name</td><td><input type="text" name="MaidenName">
<%
dim DNVar
if request.form("MaidenName") > "" then
DNVar = request.form("MaidenName")
else
DNVar = request.form("LastName")
end if
%>
<input type="hidden" name="DisplayedName" value="<%= DNVar>"></td>
</tr>
</table>

This won't do it. It always returns null for the hidden input
"DisplayedName" unless I assign DNVar a constant. If I assign a constant
to DNVar, it'll write that to the database just fine. Would anyone
happen to have any ideas how to to do this in a way that, umm... might
actually work? LOL.
 
R

Roland Hall

in message : Any of you guys got a clue of how to assign a value from one input
: box to another hidden input? What I'm trying to do is take inputs for
: names on a registration page. You've got first, middle, last, and maiden
: name inputs, but in the database you've got first, middle, last, maiden,
: and displayed last name columns. The object is to have the page sample
: the maiden name input and if there's anything in that input text box, it
: should write that value to the displayed last name column, and if it's
: empty it should write value of the last name input text box to the
: displayed last name column. The object is to have "Melissa Porker" who
: we all knew and loved in high school as "Melissa Petite" (now married to
: Piggly Porker) to display as "Melissa Petite" on the web site so all of
: her classmates will recognize her name (even if they don't recognize her
: picture :) ), while displaying "Melissa Ethridge" as "Melissa
: Ethridge" cuz she never got married. I've tried the following route but
: it refuses to work:

Hopefully this is on a postback but you need to change this one line:

if request.form("MaidenName") > "" then

should be:

if request.form("MaidenName") <> "" then
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top