|
-
Jul 18th, 2001, 10:35 AM
#1
Thread Starter
Hyperactive Member
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:
<%
Dim myVar, Account, Date1, Amount
myVar = Request.Form("Account") & Request.Form("Date1") & Request.Form("Amount")
%>
<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
-
Jul 18th, 2001, 10:45 AM
#2
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.
-
Jul 18th, 2001, 10:46 AM
#3
Thread Starter
Hyperactive Member
i tried that but it does not work.
Thanks Alot,
David Gottlieb
CIW Certified Internet Webmaster
Web Developer/Designer
-
Jul 18th, 2001, 10:47 AM
#4
Thread Starter
Hyperactive Member
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
-
Jul 18th, 2001, 01:36 PM
#5
Fanatic Member
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
-
Jul 18th, 2001, 01:37 PM
#6
Thread Starter
Hyperactive Member
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
-
Jul 18th, 2001, 01:44 PM
#7
Thread Starter
Hyperactive Member
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
-
Jul 18th, 2001, 01:44 PM
#8
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|