Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 20th, 2005, 12:02 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

i looked at that code you sent me its link.it sends values to same page.but i eant to send my form values to another page to have diffrenet tables in that page and also have the ability of dependent menues in the first page.should i still have just one form????

 
Old August 20th, 2005, 02:37 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Why don't you try it out?? With a bit of Googling, the article I linked to and a lot of trial and error, you should be able to get this working.

Anyway, if you want two pages, that's fine too. Both options will work, so choose whatever you feel comfortable with. I often use 1 asp page that posts back to itself, so I only have one page to maintain. But two pages will work just as well.

In both cases, you still need one form per page. Page 1 has a form with a drop-down and posts to Page 2. That page looks at the posted form values and builds a new drop-down based on that data.

I think I recommended it before, but I really think you should get (and read) a couple of good books on ASP. This is all pretty standard stuff, and this shouldn't take days to build. You're wasting your own valuable time with this because you seem to be missing a few fundamental concepts in web programming. Get some books, read read read and then try again and read some more....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old August 20th, 2005, 04:05 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

i think i didn't explain correctly.i don't want 2 pages for my selects.i want just a page for my menus and (i mean my dependent menu)and then both of these values with other selects andcheck boxes in this page should post to the next page.so the second page is something deference from first page.i search google but most of them got data from data base and they had 2 tables.and they just post the first select to get the second select.but my form ashould send these values to another page too.i will search again.ofcourse i have book in asp but it didn't say anything about these kinds of select.i tried the 2 form sollution too.but it doesn't send select value to same page

 
Old August 20th, 2005, 04:18 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

In that case, set the form's action to Page1.asp on the initial load of the page and show the first drop-down.
When the user makes a selection, the page will post back to Page1.asp. Then use the drop-down's value to determine the items in the second list. Also, dynamically (with ASP code) change the form's action to Page2.asp.

This way you collect all info on Page1. When you have what you need, you post to page 2.

If this doesn't help, I suggest you post some (relevant) code and ask specific questions. We're not going to write this for you, but with targeted questions we may be able to help you out.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old August 21st, 2005, 01:42 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

i don't know where is the problem but now it doesn't show any thing it shows just a wite page.i did like this:
put a form in 1.asp and action is 1.asp
put a select with onchange that it is fuction calling that put some values in array:
<select name="SiteWorkshop" class="select-type1" onChange="MM_callJS(' setDynaList(arrDL1)')">
<option>...</option>
</select>
put a select without any option
and then decalre a record set for second select with the first select filter:
select * from mytable where Site=" + Replace(rs1__MMColParam, "'", "''") + "
then call fuction above for body too


 
Old August 21st, 2005, 03:09 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

This isn't really helpful code as it shows none of your coding logic.

What does setDynaList(arrDL1) do? What valu does arrDL1 have? Is that a client side or a server side variable?

Are you mixing client and server side code, or are you making a pure client side JavaScript solution?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old August 21st, 2005, 04:01 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

First of all sorry for these much lines of codes.because i didn't know where is my problem with my codes.my codes are server side and client side together.Dynalist(arrDL1) is as below:
<script language="JavaScript">
<!--

var arrDynaList = new Array();
var arrDL1 = new Array();

arrDL1[1] = "SiteWorkshop"; // Name of parent list box
arrDL1[2] = "form1"; // Name of form containing parent list box
arrDL1[3] = "HGNo"; // Name of child list box
arrDL1[4] = "form1"; // Name of form containing child list box
arrDL1[5] = arrDynaList;

<%
Dim txtDynaListRelation, txtDynaListLabel, txtDynaListValue, oDynaListRS

txtDynaListRelation = "SiteWorkshop" ' Name of recordset field relating to parent
txtDynaListLabel = "HGNo" ' Name of recordset field for child Item Label
txtDynaListValue = "HGNo" ' Name of recordset field for child Value
Set oDynaListRS = rs1 ' Name of child list box recordset

Dim varDynaList
varDynaList = -1

Dim varMaxWidth
varMaxWidth = "1"

Dim varCheckGroup
varCheckGroup = oDynaListRS.Fields.Item(txtDynaListRelation).Value

Dim varCheckLength
varCheckLength = 0

Dim varMaxLength
varMaxLength = 0

While (NOT oDynaListRS.EOF)

If (varCheckGroup <> oDynaListRS.Fields.Item(txtDynaListRelation).Value ) Then
If (varCheckLength > varMaxLength) Then
varMaxLength = varCheckLength
End If
varCheckLength = 0
End If
%>
arrDynaList[<%=(varDynaList+1)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListRelation). Value)%>"
arrDynaList[<%=(varDynaList+2)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListLabel).Val ue)%>"
arrDynaList[<%=(varDynaList+3)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListValue).Val ue)%>"
<%
If (len(oDynaListRS.Fields.Item(txtDynaListLabel).Val ue) > len(varMaxWidth)) Then
varMaxWidth = oDynaListRS.Fields.Item(txtDynaListLabel).Value
End If
varCheckLength = varCheckLength + 1
varDynaList = varDynaList + 3
oDynaListRS.MoveNext()
Wend

If (varCheckLength > varMaxLength) Then
varMaxLength = varCheckLength
End If
%>

//-->
</script>
my second select options are like this:
<select name="HGNo" distinct>
                            <%
Dim varLoopCounter
For varLoopCounter = 1 TO varMaxLength
%>
                            <option value = "<%=varMaxWidth%>" selected><%=varMaxWidth%></option>
                            <%
Next
%>
                          </select>
 
Old August 21st, 2005, 04:53 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I don't think I can be much good in trying to make this work for you.

I don't know when this code runs, how it's triggered, what data you get from the database, how you determine when the page is posted back and you need to fill in the new drop down etc. etc. etc.

It's also a bit too much code (especially if you post the rest of the code that goes with it) for me to dissect and fix. All I can suggest is take a working example (possibly from the ASP101 site) and then step by step change it to your requirements.
That way, you understand what the code is doing, and why things do or don't work.

Cheers,

Imar
 
Old August 21st, 2005, 05:25 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

thank you for your guidance.i though that the codes are too much too but i didn't know how cani explain it for you.anyway thank you for your help.you helped me very much since i've written my first question in this forum and i can't forget your kindness.i will search again and i hope i find they sollution.

 
Old August 22nd, 2005, 07:30 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

thank you imar.the link was very usefull and my problem with my page is solved.but there is something lef.some of my database fielads repeat and i don't want to have them more than once in my select list.in asp.net we use distinct i think for avoiding repeat values but how can i do it with asp?





Similar Threads
Thread Thread Starter Forum Replies Last Post
send parameters from asp page to an asp.net form hastikeyvan ASP.NET 1.0 and 1.1 Basics 2 March 29th, 2008 01:32 AM
Can't send form values using CDO voyeur Classic ASP Components 1 February 27th, 2008 03:55 PM
Looping thru Form values posted to a page.. kingroon ASP.NET 2.0 Basics 1 February 13th, 2008 02:07 PM
How do I send boolean values with a checkbox babou SQL Server ASP 2 March 28th, 2005 05:43 AM
Combo box with different display and send values iniro VB.NET 2002/2003 Basics 3 November 9th, 2004 12:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.