473,699 Members | 2,693 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.frmSof tware.cdoProjec t.options[cdoProject.sele ctedIndex].value

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

}
function Submit(){
document.frmSof tware.action =
"Process.asp?De veloper=<%=Requ est.Form("XXX") %>";
document.frmSof tware.submit();
}
....
<form name="frmSoftwa re" method="post">
.....

Set cmd.ActiveConne ction = oConn
cmd.CommandText = "SELECT tp_id, tp_title, tp_assigned_to FROM
Projects;"
Set rs = cmd.execute
........
<select size="1" id="cdoProject " name="cdoProjec t"
onchange="javas cript:getProjec t()">
<option value="SELECT"> SELECT</option>
<%
Dim id, vProject
'EXECUTING- STORED QUERY- "SERVER_DROPDOW N"
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 2805
SelectedItem.Va lue
--
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.goo gle.com...
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.frmSof tware.cdoProjec t.options[cdoProject.sele ctedIndex].value
//but how do I get tp_id to get tp_assigned_to? ????

}
function Submit(){
document.frmSof tware.action =
"Process.asp?De veloper=<%=Requ est.Form("XXX") %>";
document.frmSof tware.submit();
}
...
<form name="frmSoftwa re" method="post">
....

Set cmd.ActiveConne ction = oConn
cmd.CommandText = "SELECT tp_id, tp_title, tp_assigned_to FROM
Projects;"
Set rs = cmd.execute
.......
<select size="1" id="cdoProject " name="cdoProjec t"
onchange="javas cript:getProjec t()">
<option value="SELECT"> SELECT</option>
<%
Dim id, vProject
'EXECUTING- STORED QUERY- "SERVER_DROPDOW N"
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.formna me.cdoProject.v alue
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("c doProject") 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.goo gle.com...
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.frmSof tware.cdoProjec t.options[cdoProject.sele ctedIndex].value
//but how do I get tp_id to get tp_assigned_to? ????

}
function Submit(){
document.frmSof tware.action =
"Process.asp?De veloper=<%=Requ est.Form("XXX") %>";
document.frmSof tware.submit();
}
...
<form name="frmSoftwa re" method="post">
....

Set cmd.ActiveConne ction = oConn
cmd.CommandText = "SELECT tp_id, tp_title, tp_assigned_to FROM
Projects;"
Set rs = cmd.execute
.......
<select size="1" id="cdoProject " name="cdoProjec t"
onchange="javas cript:getProjec t()">
<option value="SELECT"> SELECT</option>
<%
Dim id, vProject
'EXECUTING- STORED QUERY- "SERVER_DROPDOW N"
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.frmSof tware.action =
"Process.asp?De veloper=<%=Requ est.Form("cdoPr oject")%>";
document.frmSof tware.submit(); Set cmd.ActiveConne ction = oConn
cmd.CommandText = "SELECT tp_id, tp_title, tp_assigned_to FROM
Projects;"
Set rs = cmd.execute
.......
<select size="1" id="cdoProject " name="cdoProjec t"
onchange="javas cript:getProjec t()">
<option value="SELECT"> SELECT</option>
<%
Dim id, vProject
'EXECUTING- STORED QUERY- "SERVER_DROPDOW N"
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.goo gle.com...
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.frmSof tware.action =
"Process.asp?De veloper=<%=Requ est.Form("cdoPr oject")%>";
document.frmSof tware.submit(); Set cmd.ActiveConne ction = oConn
cmd.CommandText = "SELECT tp_id, tp_title, tp_assigned_to FROM
Projects;"
Set rs = cmd.execute
.......
<select size="1" id="cdoProject " name="cdoProjec t"
onchange="javas cript:getProjec t()">
<option value="SELECT"> SELECT</option>
<%
Dim id, vProject
'EXECUTING- STORED QUERY- "SERVER_DROPDOW N"
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
8289
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 dropdown lists. If you change the selection of the left one (e.g. choose parentoption2), it should open up page2.htm in a popup window.
1
1759
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 OnSelectedIndexChange event. However, I am unable to retrieve the value of the DropDownList after the PostBack. I have tried dropdown.SelectedValue, dropdown.SelectedItem.Value, and dropdown.SelectedIndex. None of these returns the page that was...
1
10175
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 is this happens as soon as the php is run so bringing up the same records filtered from the default index. Also when I select a new index no from the drop down list is doesnt refilter the records bringing up the ones for the new list. It still...
15
2966
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 it. Simple database: I want to have a user enter Supply Orders (just for tracking purposes) by Item. The user may also enter a new item - "new" is a combination of Item, PartNumber and Vendor - they could have the
6
3340
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..... Is there any java script to do this functionality...
0
1346
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 textbox control which has a ‘TextMode’ property and when clicked on, displays as a dropdown list with 3 values, I want to have a similar type property with a dropdown style. So far, I have a property defined which displays the dropdown arrow...
0
1610
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 textbox control which has a 'TextMode' property and when clicked on, displays as a dropdown list with 3 values, I want to have a similar type property with a dropdown style.
5
6657
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 according to selection made in first dropdown list and it will also come from ms-access database.(for example if i am selecting country as india in first dropdown list then in second dropdown list will show states of india) the problem is that i...
5
10347
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 I would like to add a checkbox or dropdown control to the .RLDC and have Item #1, Item #2, or Item #3 display conditionally based on a checkbox being clicked or a dropdown value being selected.
0
8615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9033
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8911
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8882
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6533
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5872
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4375
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2345
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.