473,386 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

dynamic form values

If I have say 10 fixed variables, how can I set their values = to that
of a form that is built dynamically?

column1 column2
email = formvalue(0)
fname = formvalue(1)
lname = formvalue(2)

etc..

lastvar = formvalue(9)
Jul 19 '05 #1
10 2094
What do you mean? <input type="text" value="<%=variableName%>">

Ray at work

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
If I have say 10 fixed variables, how can I set their values = to that
of a form that is built dynamically?

column1 column2
email = formvalue(0)
fname = formvalue(1)
lname = formvalue(2)

etc..

lastvar = formvalue(9)

Jul 19 '05 #2
No, I would need to loop though the values of a drop down list and
assign value1 to email, value2 to fname...

Ray at <%=sLocation%> [MVP] wrote:
What do you mean? <input type="text" value="<%=variableName%>">

Ray at work

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
If I have say 10 fixed variables, how can I set their values = to that
of a form that is built dynamically?

column1 column2
email = formvalue(0)
fname = formvalue(1)
lname = formvalue(2)

etc..

lastvar = formvalue(9)


Jul 19 '05 #3
When, when the page is submitted? When it is loaded? Can you explain this
in a little more detail?

Ray at work

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
No, I would need to loop though the values of a drop down list and
assign value1 to email, value2 to fname...

Ray at <%=sLocation%> [MVP] wrote:
What do you mean? <input type="text" value="<%=variableName%>">

Ray at work

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
If I have say 10 fixed variables, how can I set their values = to that
of a form that is built dynamically?

column1 column2
email = formvalue(0)
fname = formvalue(1)
lname = formvalue(2)

etc..

lastvar = formvalue(9)


Jul 19 '05 #4
> No, I would need to loop though the values of a drop down list and
assign value1 to email, value2 to fname...


When you have a drop-down box only the selected item is submitted with the
form, the non-selected values are "lost"
Jul 19 '05 #5
A user will fill out the dropdown list and hit submit - a form will then
map the constants to the form values to build a SQL string that will
be passed to a stored procedure.

Ray at <%=sLocation%> [MVP] wrote:
When, when the page is submitted? When it is loaded? Can you explain this
in a little more detail?

Ray at work

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
No, I would need to loop though the values of a drop down list and
assign value1 to email, value2 to fname...

Ray at <%=sLocation%> [MVP] wrote:

What do you mean? <input type="text" value="<%=variableName%>">

Ray at work

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl. ..
If I have say 10 fixed variables, how can I set their values = to that
of a form that is built dynamically?

column1 column2
email = formvalue(0)
fname = formvalue(1)
lname = formvalue(2)

etc..

lastvar = formvalue(9)


Jul 19 '05 #6
Yes, I don't want the non-selected values.

The form is built dynamically from an uploaded .csv -- the first line of
the .csv is loaded into a drop down list. There is another, static list
that matches up with those values.

Adrian Forbes [ASP MVP] wrote:
No, I would need to loop though the values of a drop down list and
assign value1 to email, value2 to fname...

When you have a drop-down box only the selected item is submitted with the
form, the non-selected values are "lost"

Jul 19 '05 #7
So, you'll have an unknown number of values to assign to an unknown number
of variables? What about putting them in an array? If I fill out your
form, and I enter these terms in your select box:

cat
bird
ferret

what is the ultimate goal as far as what your SQL string will look like?

Ray at home

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl...
A user will fill out the dropdown list and hit submit - a form will then
map the constants to the form values to build a SQL string that will
be passed to a stored procedure.

Ray at <%=sLocation%> [MVP] wrote:
When, when the page is submitted? When it is loaded? Can you explain this in a little more detail?

Ray at work

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
No, I would need to loop though the values of a drop down list and
assign value1 to email, value2 to fname...

Ray at <%=sLocation%> [MVP] wrote:
What do you mean? <input type="text" value="<%=variableName%>">

Ray at work

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl. ..
>If I have say 10 fixed variables, how can I set their values = to that
>of a form that is built dynamically?
>
>column1 column2
>email = formvalue(0)
>fname = formvalue(1)
>lname = formvalue(2)
>
>etc..
>
>lastvar = formvalue(9)


Jul 19 '05 #8
Hey Ray, thanks for sticking in...

I'll have an unknown number of values loaded from the .CSV, but no more
than 10. There will also be a fixed number of variables to assign them
to. If there is only 7 loaded the rest will be set to "".

The .csv might have user user_email, first_name, last_name so they would
map those to the fixed values email, fname, lname.

The SQL string is a very simple insert:

insert into tbl_test (email, fname, lname)
values ('"&user_email&"','"&first_name&"','"&last_name&"' )
This is the basic idea:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="300">
<tr>
<td>Fixed List</td>
<td>CSV List</td>
</tr>
<tr>
<td>Email</td>
<td><select name="flds">
<option name="none" value="none">none</option>
<option name="user_email" value="user_email">user_email</option>
<option name="user_fname" value="user_fname">user_fname</option>
<option name="user_lname" value="user_lname">user_lname</option>
</select></td>
</tr>
<tr>
<td>First Name</td>
<td><select name="flds">
<option name="none" value="none">none</option>
<option name="user_email" value="user_email">user_email</option>
<option name="user_fname" value="user_fname">user_fname</option>
<option name="user_lname" value="user_lname">user_lname</option>
</select></td>
</tr>
<tr>
<td>Last Name</td>
<td><select name="flds">
<option name="none" value="none">none</option>
<option name="user_email" value="user_email">user_email</option>
<option name="user_fname" value="user_fname">user_fname</option>
<option name="user_lname" value="user_lname">user_lname</option>
</select></td>
</tr>
</table>
</body>
</html>

Ray at <%=sLocation%> [MVP] wrote:
So, you'll have an unknown number of values to assign to an unknown number
of variables? What about putting them in an array? If I fill out your
form, and I enter these terms in your select box:

cat
bird
ferret

what is the ultimate goal as far as what your SQL string will look like?

Ray at home

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl...
A user will fill out the dropdown list and hit submit - a form will then
map the constants to the form values to build a SQL string that will
be passed to a stored procedure.

Ray at <%=sLocation%> [MVP] wrote:

When, when the page is submitted? When it is loaded? Can you explain
this
in a little more detail?

Ray at work

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl. ..
No, I would need to loop though the values of a drop down list and
assign value1 to email, value2 to fname...

Ray at <%=sLocation%> [MVP] wrote:

>What do you mean? <input type="text" value="<%=variableName%>">
>
>Ray at work
>
>"Dave Karmens" <sp*************@yahoo.ca> wrote in message
>news:%2****************@TK2MSFTNGP09.phx.gbl. ..
>
>
>
>>If I have say 10 fixed variables, how can I set their values = to that
>>of a form that is built dynamically?
>>
>>column1 column2
>>email = formvalue(0)
>>fname = formvalue(1)
>>lname = formvalue(2)
>>
>>etc..
>>
>>lastvar = formvalue(9)
>
>
>


Jul 19 '05 #9
In that case, split your select value and assign the values to your
variables, like:

On Error Resume Next
firstvar = Request.Form("select")(1)
secondvar = Request.Form("select")(2)
thirdvar = Request.Form("select")(3)
fourthvar = Request.Form("select")(4)
fifthvar = Request.Form("select")(5)
sixthvar = Request.Form("select")(6)
seventhvar = Request.Form("select")(7)
eighthvar = Request.Form("select")(8)
ninthvar = Request.Form("select")(9)
tenthvar = Request.Form("select")(10)
On Error Goto 0

Ray at work


"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:Oz**************@TK2MSFTNGP12.phx.gbl...
Hey Ray, thanks for sticking in...

I'll have an unknown number of values loaded from the .CSV, but no more
than 10. There will also be a fixed number of variables to assign them
to. If there is only 7 loaded the rest will be set to "".

The .csv might have user user_email, first_name, last_name so they would
map those to the fixed values email, fname, lname.

The SQL string is a very simple insert:

insert into tbl_test (email, fname, lname)
values ('"&user_email&"','"&first_name&"','"&last_name&"' )
This is the basic idea:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="300">
<tr>
<td>Fixed List</td>
<td>CSV List</td>
</tr>
<tr>
<td>Email</td>
<td><select name="flds">
<option name="none" value="none">none</option>
<option name="user_email" value="user_email">user_email</option>
<option name="user_fname" value="user_fname">user_fname</option>
<option name="user_lname" value="user_lname">user_lname</option>
</select></td>
</tr>
<tr>
<td>First Name</td>
<td><select name="flds">
<option name="none" value="none">none</option>
<option name="user_email" value="user_email">user_email</option>
<option name="user_fname" value="user_fname">user_fname</option>
<option name="user_lname" value="user_lname">user_lname</option>
</select></td>
</tr>
<tr>
<td>Last Name</td>
<td><select name="flds">
<option name="none" value="none">none</option>
<option name="user_email" value="user_email">user_email</option>
<option name="user_fname" value="user_fname">user_fname</option>
<option name="user_lname" value="user_lname">user_lname</option>
</select></td>
</tr>
</table>
</body>
</html>

Ray at <%=sLocation%> [MVP] wrote:
So, you'll have an unknown number of values to assign to an unknown number of variables? What about putting them in an array? If I fill out your
form, and I enter these terms in your select box:

cat
bird
ferret

what is the ultimate goal as far as what your SQL string will look like?

Ray at home

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl...
A user will fill out the dropdown list and hit submit - a form will then
map the constants to the form values to build a SQL string that will
be passed to a stored procedure.

Ray at <%=sLocation%> [MVP] wrote:
When, when the page is submitted? When it is loaded? Can you explain


this
in a little more detail?

Ray at work

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl. ..
>No, I would need to loop though the values of a drop down list and
>assign value1 to email, value2 to fname...
>
>Ray at <%=sLocation%> [MVP] wrote:
>
>
>
>>What do you mean? <input type="text" value="<%=variableName%>">
>>
>>Ray at work
>>
>>"Dave Karmens" <sp*************@yahoo.ca> wrote in message
>>news:%2****************@TK2MSFTNGP09.phx.gbl. ..
>>
>>
>>
>>>If I have say 10 fixed variables, how can I set their values = to that>>>of a form that is built dynamically?
>>>
>>>column1 column2
>>>email = formvalue(0)
>>>fname = formvalue(1)
>>>lname = formvalue(2)
>>>
>>>etc..
>>>
>>>lastvar = formvalue(9)
>>
>>
>>


Jul 19 '05 #10
Aaaah that looks like it will do! Thanks Ray!
Ray at <%=sLocation%> [MVP] wrote:
In that case, split your select value and assign the values to your
variables, like:

On Error Resume Next
firstvar = Request.Form("select")(1)
secondvar = Request.Form("select")(2)
thirdvar = Request.Form("select")(3)
fourthvar = Request.Form("select")(4)
fifthvar = Request.Form("select")(5)
sixthvar = Request.Form("select")(6)
seventhvar = Request.Form("select")(7)
eighthvar = Request.Form("select")(8)
ninthvar = Request.Form("select")(9)
tenthvar = Request.Form("select")(10)
On Error Goto 0

Ray at work


"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:Oz**************@TK2MSFTNGP12.phx.gbl...
Hey Ray, thanks for sticking in...

I'll have an unknown number of values loaded from the .CSV, but no more
than 10. There will also be a fixed number of variables to assign them
to. If there is only 7 loaded the rest will be set to "".

The .csv might have user user_email, first_name, last_name so they would
map those to the fixed values email, fname, lname.

The SQL string is a very simple insert:

insert into tbl_test (email, fname, lname)
values ('"&user_email&"','"&first_name&"','"&last_name&"' )
This is the basic idea:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="300">
<tr>
<td>Fixed List</td>
<td>CSV List</td>
</tr>
<tr>
<td>Email</td>
<td><select name="flds">
<option name="none" value="none">none</option>
<option name="user_email" value="user_email">user_email</option>
<option name="user_fname" value="user_fname">user_fname</option>
<option name="user_lname" value="user_lname">user_lname</option>
</select></td>
</tr>
<tr>
<td>First Name</td>
<td><select name="flds">
<option name="none" value="none">none</option>
<option name="user_email" value="user_email">user_email</option>
<option name="user_fname" value="user_fname">user_fname</option>
<option name="user_lname" value="user_lname">user_lname</option>
</select></td>
</tr>
<tr>
<td>Last Name</td>
<td><select name="flds">
<option name="none" value="none">none</option>
<option name="user_email" value="user_email">user_email</option>
<option name="user_fname" value="user_fname">user_fname</option>
<option name="user_lname" value="user_lname">user_lname</option>
</select></td>
</tr>
</table>
</body>
</html>

Ray at <%=sLocation%> [MVP] wrote:
So, you'll have an unknown number of values to assign to an unknown
number
of variables? What about putting them in an array? If I fill out your
form, and I enter these terms in your select box:

cat
bird
ferret

what is the ultimate goal as far as what your SQL string will look like?

Ray at home

"Dave Karmens" <sp*************@yahoo.ca> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl...
A user will fill out the dropdown list and hit submit - a form will then
map the constants to the form values to build a SQL string that will
be passed to a stored procedure.

Ray at <%=sLocation%> [MVP] wrote:

>When, when the page is submitted? When it is loaded? Can you explain

this
>in a little more detail?
>
>Ray at work
>
>"Dave Karmens" <sp*************@yahoo.ca> wrote in message
>news:%2****************@TK2MSFTNGP09.phx.gbl. ..
>
>
>
>>No, I would need to loop though the values of a drop down list and
>>assign value1 to email, value2 to fname...
>>
>>Ray at <%=sLocation%> [MVP] wrote:
>>
>>
>>
>>
>>>What do you mean? <input type="text" value="<%=variableName%>">
>>>
>>>Ray at work
>>>
>>>"Dave Karmens" <sp*************@yahoo.ca> wrote in message
>>>news:%2****************@TK2MSFTNGP09.phx.gb l...
>>>
>>>
>>>
>>>
>>>>If I have say 10 fixed variables, how can I set their values = to
that
>>of a form that is built dynamically?
>>>>
>>>>column1 column2
>>>>email = formvalue(0)
>>>>fname = formvalue(1)
>>>>lname = formvalue(2)
>>>>
>>>>etc..
>>>>
>>>>lastvar = formvalue(9)
>>>
>>>
>>>


Jul 19 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: propizzy | last post by:
Appreciate any help!!! PROBLEM: I have this form that allows the user to dynamically create additional fields (see javascript code bellow). I am trying to retrieve the values entered into these...
2
by: Nick | last post by:
Loop to create an array from a dynamic form. I'm having trouble with an application, and I'll try to explain it as clearly as possible: 1. I have a form with two fields, say Apples and...
7
by: Jack | last post by:
Hi, I am trying to test a sql statement in Access which gives me the error as stated in the heading. The sql statement is built as a part of asp login verification, where the userid and password...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
2
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
0
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
2
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
2
by: englishman69 | last post by:
Hello, I have been banging my head against this one for a while... Searches online have revealed many different proposals for correcting my issue but none that I can follow! My basic situation...
4
by: =?Utf-8?B?RHlsYW5TbWl0aA==?= | last post by:
I have a WebForm where I'm dynamically creating some controls and I'm having difficulty understanding how the state is being persisted and how to work with it. I've created a simplified example...
1
by: jmartmem | last post by:
Greetings, I have a nagging problem with client-side dynamic dependent list boxes that perhaps someone can help me troubleshoot. I have a form with a series of dynamic dependent list boxes....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.