Funky input methods...

Discussion in 'ASP General' started by Me, Jul 23, 2005.

  1. Me

    Me Guest

    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.
     
    Me, Jul 23, 2005
    #1
    1. Advertising

  2. Me

    Roland Hall Guest

    "Me" wrote in message news:dbsgph$2nan$...
    : 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
     
    Roland Hall, Jul 23, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Diogenes Dilone

    Funky error Situation

    Diogenes Dilone, Jan 6, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    552
    Diogenes Dilone
    Jan 7, 2004
  2. =?Utf-8?B?VHJhY3k=?=

    Funky address change.

    =?Utf-8?B?VHJhY3k=?=, Mar 16, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    396
    Juan T. Llibre
    Mar 16, 2006
  3. iksrazal

    funky but simple regex

    iksrazal, Jul 19, 2004, in forum: Java
    Replies:
    3
    Views:
    403
    iksrazal
    Jul 20, 2004
  4. dwilson
    Replies:
    0
    Views:
    1,259
    dwilson
    Apr 8, 2005
  5. Pete
    Replies:
    7
    Views:
    432
Loading...

Share This Page