Results 1 to 8 of 8

Thread: Please!!!!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263

    Please!!!!

    Ok. I have 2 textboxes and one hidden field in my form. I need to concatenate all of those into one hidden field to be submitted as one string to my script. This is the code that I have now. Can I please get some help?

    VB Code:
    1. <%
    2.     Dim myVar, Account, Date1, Amount
    3.    
    4.    
    5.     myVar =  Request.Form("Account") & Request.Form("Date1") & Request.Form("Amount")
    6. %>
    7.  
    8.     <INPUT TYPE="hidden" ID=TopicItemNamePrefix NAME=TopicItemNamePrefix VALUE="<%=myVar%>">

    What is the problem here??
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Why cant you do the string conc. in the script you are psoting to? which is what this:

    myVar = Request.Form("Account") & Request.Form("Date1") & Request.Form("Amount")


    will do.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    i tried that but it does not work.
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    How would I define for the value of those concatenated to be in that hidden field?
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  5. #5
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602
    Are you building the string to be submitted on the client side?
    If so you can't use VBScript/ASP to do this.
    If you are using one form to submit one string.
    Try splitting it up into two forms. One for the data collection and the other for submitting.
    Code:
    <script LANGUAGE = "JavaScript">
    function concatString(){
    
    frmSubInfo.hiddenString.value = frmInfo.txtAccount.value + frmInfo.txtDate.value;
    return true;
    }
    </script>
    
    <form NAME = "frmInfo">
    <input TYPE = "text" NAME = "txtAccount">
    <input TYPE = "text" NAME = "txtDate">
    </form>
    <form NAME = "frmSubInfo" ACTION = "youraction" ONSUBMIT = "concatString();">
    <input TYPE = "hidden" NAME = "hiddenString" VALUE = "">
    <input TYPE = "submit" VALUE = "Submit">
    </form>

    Chris
    Chris

    VB 6.0 Calendar App Video Gamers Group
    Don't forget to rate people if they helped you.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    The script I am submitting to is from an outside vendor. I am just trying to incorporate it into my piece. There is no easier way to concatenate the values of the text boxes in to one????
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    263
    THis is being submitted to a script on the server side. Can I do that with ASP? I tried hardcoding into variables the actual text i want concatenated and it works fine. How can I do the same thing but with textfields? It can't be that much more difficult.
    Thanks Alot,

    David Gottlieb
    CIW Certified Internet Webmaster
    Web Developer/Designer

  8. #8
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    you can before submitting:

    <form onSubmit="concatenate();">

    in concatenated:

    document.yourFormName.yourHiddenField.value=document.yourFormName.your1Field + document.yourFormName.your2Field+document.yourFormName.your3Field;

    something like that!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width