 |
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
|
|
|
|

August 14th, 2005, 01:47 AM
|
|
Friend of Wrox
|
|
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
send form values to different page
Hello all
i have a form with 2 objects:supplier and HGNo when we select supplier it should give me just the HG of that supplier and the same for HG and Supplier.and my form should send these 2 values to the next page for filtering.should i make 2 forms that on of them is in the another one with the action to itself and the other one to filter page????
thank you
|
|

August 15th, 2005, 09:40 AM
|
|
Friend of Wrox
|
|
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i made tow form in my pages it is working.but it doesn't show the value of check boxes can we write it like this?
<%Dim rs_MMColParam
MMColParam=Request.Form("SiteWorkshop")%>
<select name="HGNo">
<%if (MMColParam="All") then
%>
<option value="null" selected>All</option>
<option value="3903">3903 Transporter seling</option>
<option value="4005">4005 signs and lable</option>
<option value="4006">4006 signs and lables</option>
<option value="4011">4011 insulation & piping
& indoor grating</option>
</select>
<%end if%>
|
|

August 16th, 2005, 02:40 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
I am not sure I understand the question (well, in fact, I *am* sure I don't understand the question)
You talk about check boxes, but I don't see one in your code. What are you trying to accomplish??
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Bust by Big Boi feat. Killer Mike (Track 7 from the album: Speakerboxxx) What's This?
|
|

August 16th, 2005, 11:07 PM
|
|
Friend of Wrox
|
|
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
you're right.i think i didn't explain it correctly.i have 2 check boxes.if we select the value of first check box the second check box should show its special values and after that send these 2 check boxes values to the next page.i don't know how should i declare my first check box value.is it corret just to put its check box name?
for exmaple if my first check box is:<select name="Supplier">
...
then i write my codes for second check box like this:
<select name="HGNo">
<%if supplier="aaaa" then%>
<option value=4070>4070</option>
.
.
.
<%end if%>
<write other if code....>
</select>
|
|

August 17th, 2005, 04:04 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Ah, I see. You're mixing up check boxes and select list. A check box is the little square that can have a check mark in it, while the select list is (often) a drop down with multiple options.
Anyway, what you need to do is this:
1. Make the first drop-down "auto postback" by adding an onchange handler that submits the form automatically.
2. On the server, retrieve the value from the first drop-down and use it in a query (if you're using a database) to get the selected child records
3. Then use a loop to create the second drop-down with the values from the database.
Take a look here: http://www.asp101.com/samples/db_pulldown_linked.asp for a simple example, or search Google
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

August 17th, 2005, 10:54 PM
|
|
Friend of Wrox
|
|
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
yes:))thats right i meant select.i don't get the second select values from the database.can i just wrote some if code fore them?
thank you for your links
|
|

August 18th, 2005, 12:20 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Sure you can. Just use If or a Select statement to determine the items in the second drop-down list. Something like this:
Code:
<select name="SecondDropDown">
<%
Select Case Request.Form("FirstDropDown")
Case "SomeValue"
%>
<option value="SomeValue">SomeValue</option>
<option value="SomeOtherValue">SomeOtherValue</option>
<%
Case "SomeOtherValue"
%>
<option value="YetAnotherValue">YetAnotherValue</option>
<%
End Select
%>
HtH,
Imar
|
|

August 18th, 2005, 01:41 AM
|
|
Friend of Wrox
|
|
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
my problem is with my forms.should i have 2 form?one in the another?or can i do it with one form????what should i write for action of my form?
|
|

August 18th, 2005, 08:34 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
One form, with a normal action that posts back to the same page. E.g.:
<form action="MyPage.asp" method="post">
Then when the page loads, see if the first drop down has a value with the Select code I showed you.....
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

August 19th, 2005, 11:26 PM
|
|
Friend of Wrox
|
|
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i put a fprm with a action to same page.but when i click submit button it gives me that page again but at the top of the page it wrote:
Key Submit2 has a value of Select
Key SiteWorkshop has a value of null
Key UnitNo has a value of null
and the menu is empty without any valu
|
|
 |