473,499 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting dropdown value

I know this is supposed to be easy but I can't get this to work. I
have a dropdown that pulls all the Projects (tp_title) available. All
I want to do is get the ID (tp_id) of that record so I can get the
developer assigned to that project (tp_assigned_to). Then, when I get
the developer, I need that to be redirected to a second page.

Example Code:
......
function getProject(){
//I know that this gets the selected value of the dropdown
var cdoProject = document.frmSoftware.cdoProject.options[cdoProject.selectedIndex].value

//but how do I get tp_id to get tp_assigned_to?????

}
function Submit(){
document.frmSoftware.action =
"Process.asp?Developer=<%=Request.Form("XXX")% >";
document.frmSoftware.submit();
}
....
<form name="frmSoftware" method="post">
.....

Set cmd.ActiveConnection = oConn
cmd.CommandText = "SELECT tp_id, tp_title, tp_assigned_to FROM
Projects;"
Set rs = cmd.execute
........
<select size="1" id="cdoProject" name="cdoProject"
onchange="javascript:getProject()">
<option value="SELECT">SELECT</option>
<%
Dim id, vProject
'EXECUTING- STORED QUERY- "SERVER_DROPDOWN"
Do until swss.EOF
id = swss.Fields("tp_id").value
vProject = swss.Field("tp_title").value
Response.Write "<option value=""" & vProject & """" & vProject &
"</option>"
swss.movenext
loop
swss.close
Set swss = Nothing
%>
</select>
<input type="button" value="Submit" name="btnSubmit"
onclick="Submit()">

Thanks in advance
Lisa
Jul 19 '05 #1
4 2796
SelectedItem.Value
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Lisa" <pe*****@yahoo.com> wrote in message
news:89**************************@posting.google.c om...
I know this is supposed to be easy but I can't get this to work. I
have a dropdown that pulls all the Projects (tp_title) available. All
I want to do is get the ID (tp_id) of that record so I can get the
developer assigned to that project (tp_assigned_to). Then, when I get
the developer, I need that to be redirected to a second page.

Example Code:
.....
function getProject(){
//I know that this gets the selected value of the dropdown
var cdoProject = document.frmSoftware.cdoProject.options[cdoProject.selectedIndex].value
//but how do I get tp_id to get tp_assigned_to?????

}
function Submit(){
document.frmSoftware.action =
"Process.asp?Developer=<%=Request.Form("XXX")% >";
document.frmSoftware.submit();
}
...
<form name="frmSoftware" method="post">
....

Set cmd.ActiveConnection = oConn
cmd.CommandText = "SELECT tp_id, tp_title, tp_assigned_to FROM
Projects;"
Set rs = cmd.execute
.......
<select size="1" id="cdoProject" name="cdoProject"
onchange="javascript:getProject()">
<option value="SELECT">SELECT</option>
<%
Dim id, vProject
'EXECUTING- STORED QUERY- "SERVER_DROPDOWN"
Do until swss.EOF
id = swss.Fields("tp_id").value
vProject = swss.Field("tp_title").value
Response.Write "<option value=""" & vProject & """" & vProject &
"</option>"
swss.movenext
loop
swss.close
Set swss = Nothing
%>
</select>
<input type="button" value="Submit" name="btnSubmit"
onclick="Submit()">

Thanks in advance
Lisa

Jul 19 '05 #2
Woops....sorry, was in .NET mode.

You are trying to get this in CLIENTside code so this isn't really the best
place but it should be something like
document.formname.cdoProject.value
At least I thought so.... I'd suggest hitting a clientside/javascript group
though

If I misread and you are trying ot get this serverside them just make sure
your dropdown uses the ID as the value and the NAME as the text for the
dropdown/select. Then just use Request.Form("cdoProject") to get the value.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Lisa" <pe*****@yahoo.com> wrote in message
news:89**************************@posting.google.c om...
I know this is supposed to be easy but I can't get this to work. I
have a dropdown that pulls all the Projects (tp_title) available. All
I want to do is get the ID (tp_id) of that record so I can get the
developer assigned to that project (tp_assigned_to). Then, when I get
the developer, I need that to be redirected to a second page.

Example Code:
.....
function getProject(){
//I know that this gets the selected value of the dropdown
var cdoProject = document.frmSoftware.cdoProject.options[cdoProject.selectedIndex].value
//but how do I get tp_id to get tp_assigned_to?????

}
function Submit(){
document.frmSoftware.action =
"Process.asp?Developer=<%=Request.Form("XXX")% >";
document.frmSoftware.submit();
}
...
<form name="frmSoftware" method="post">
....

Set cmd.ActiveConnection = oConn
cmd.CommandText = "SELECT tp_id, tp_title, tp_assigned_to FROM
Projects;"
Set rs = cmd.execute
.......
<select size="1" id="cdoProject" name="cdoProject"
onchange="javascript:getProject()">
<option value="SELECT">SELECT</option>
<%
Dim id, vProject
'EXECUTING- STORED QUERY- "SERVER_DROPDOWN"
Do until swss.EOF
id = swss.Fields("tp_id").value
vProject = swss.Field("tp_title").value
Response.Write "<option value=""" & vProject & """" & vProject &
"</option>"
swss.movenext
loop
swss.close
Set swss = Nothing
%>
</select>
<input type="button" value="Submit" name="btnSubmit"
onclick="Submit()">

Thanks in advance
Lisa

Jul 19 '05 #3
Curt,
Yeah I tried that already and it didn't work the value of cdoProject
is blank- unless I have the syntax wrong?

function Submit(){
document.frmSoftware.action =
"Process.asp?Developer=<%=Request.Form("cdoProject ")%>";
document.frmSoftware.submit(); Set cmd.ActiveConnection = oConn
cmd.CommandText = "SELECT tp_id, tp_title, tp_assigned_to FROM
Projects;"
Set rs = cmd.execute
.......
<select size="1" id="cdoProject" name="cdoProject"
onchange="javascript:getProject()">
<option value="SELECT">SELECT</option>
<%
Dim id, vProject
'EXECUTING- STORED QUERY- "SERVER_DROPDOWN"
Do until swss.EOF
id = swss.Fields("tp_id").value
vProject = swss.Field("tp_title").value
Response.Write "<option value=""" & id & """" & vProject &
"</option>"
swss.movenext
loop
swss.close
Set swss = Nothing
%>
</select>

Jul 19 '05 #4
its your Select tag most likely...
do you have value attributes on each of the items in the select tag?

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Lisa" <pe*****@yahoo.com> wrote in message
news:89**************************@posting.google.c om...
Curt,
Yeah I tried that already and it didn't work the value of cdoProject
is blank- unless I have the syntax wrong?

function Submit(){
document.frmSoftware.action =
"Process.asp?Developer=<%=Request.Form("cdoProject ")%>";
document.frmSoftware.submit(); Set cmd.ActiveConnection = oConn
cmd.CommandText = "SELECT tp_id, tp_title, tp_assigned_to FROM
Projects;"
Set rs = cmd.execute
.......
<select size="1" id="cdoProject" name="cdoProject"
onchange="javascript:getProject()">
<option value="SELECT">SELECT</option>
<%
Dim id, vProject
'EXECUTING- STORED QUERY- "SERVER_DROPDOWN"
Do until swss.EOF
id = swss.Fields("tp_id").value
vProject = swss.Field("tp_title").value
Response.Write "<option value=""" & id & """" & vProject &
"</option>"
swss.movenext
loop
swss.close
Set swss = Nothing
%>
</select>

Jul 19 '05 #5

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

Similar topics

1
8253
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
1
1745
by: John Smith | last post by:
I have a Repeater that is paginated, and I would like the user to navigate to each page via a DropDownList. I have set the AutPostBack attribute to true and written code that fires on the...
1
10162
by: Ian Davies | last post by:
Hello In a php file I have a drop down list with index numbers in whos default value is feed into an sql query that filters records from my database and displays them in an html table. Trouble...
15
2943
by: sara | last post by:
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting...
6
3323
by: Charleees | last post by:
Hi all, I have a DropDown and a TextBox just bekeow it... I have to get the selected value from dropdown and set it as textBox Text.. The thing is i have to do this Without PostBack..... ...
0
1335
by: Kay | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
0
1598
by: Kay O'Keeffe | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
5
6639
by: abhi3211 | last post by:
i am using java inside java script page. in that page i want to use two dropdown list. in first dropdown list i am getting data from ms-access database. in second dropdown list i want to get data...
5
10321
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a VS 2008 ASP.NET webform that has a reportview tag on it, accessing an .RLDC report in local report. The columns for the report are essentially: Month Item #1 Item#2 Item#3 ...
0
7012
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7225
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...
1
6901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5479
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3105
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.