| Posted By |
Discussion Topic: open new window with two select
-- page:
1
2
|
|
asamuel |
03-11-2004 @ 3:28 PM |
|
|
Junior Member
Posts: 79
Joined: Oct 2003
|
Hi Folks, What I am trying to do, i need some help with it,user will select one of the ATD type, and if they choose yesfor instrumentation they will get two option, standard or other instrumentation, and it depends on these two select they will get the proper form, basically the ATD select this is the one it define the form, but how to make it if they choose standard will get the standard form, or the other one if they choose that, your input is really appreciate it. <html> <head> <title>Driver Matrix Form</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script> function testyes(){ MMDIVpanel.style.visibility='visible'; document.getElementById('panel').style.left=10; document.getElementById('panel').style.top=550; form.test1.focus();} function testno() { MMDIVpanel.style.visibility='hidden'; document.getElementById('panel').style.left=10; document.getElementById('panel').style.top=520; } </script> <style type="text/css"> .Questions { font-family: "Times New Roman", Times, serif; font-size: medium; font-style: normal; font-weight: bold; color: #FF0000; display: block; } .ATD { font-family: "Times New Roman", Times, serif; font-size: medium; font-style: normal; line-height: normal; font-weight: bold; color: #009900; } </style> </head> <body> <cfform name="dmatrix" action="dmatrix_action.cfm"> <table width="84%" border="0" cellspacing="10" cellpadding="0"> <tr> <td colspan="2"><h2 align="center"><font color="#0000FF"><u>Driver Matrix form</u></font></h2></td> </tr> <tr> <td colspan="2"><h3><font color="#0000FF"><strong>Please supply us with all the information below about the <font size="5">ATD:</font></strong></font></h3></td> </tr> <tr> <td width="52%" class="Questions"><strong>Please define ATD Type?</strong></td> <td width="48%"><select name="atdtype" id="select"> <option>Please choose one</option> <option>Hybrid III 5th</option> <option>Hybrid III 50th</option> <option>Hybrid III 95th</option> <option>Hybrid III 6 Year old</option> <option>Hybrid III 3 Year old</option> <option>3 Year old airbag</option> <option>Sid IIS</option> <option>DOT SID</option> <option>BioSID</option> <option>EuroSID</option> <option>6 Month CRABI</option> <option>12 Month CRABI</option> <option>TNO 10</option> </select></td> </tr> <tr> <td class="Questions">Is there any instrumentation required?</td> <td><table width="69%" border="0" cellspacing="5" cellpadding="0"> <tr> <td width="34%"><input name="ReqInstru" type="radio" value="No" onClick="testno();"> <strong>No</strong></td> <td width="66%"><input type="radio" name="ReqInstru" value="Yes" onClick="testyes();"> <strong>Yes</strong></td> </tr> </table></td> </tr> </table> <div id="MMDIVpanel" style="visibility:hidden"> <tr> <td colspan="2" id="test1"><div align="center"> <input name="instrument" type="radio" value="Autoliv"> <strong>Standard Instrumentation </strong> <input name="instrument" type="radio" value="custom"> <strong>Other Instrumentation</strong></div></td> </tr> </div> <table width="685"> <tr style="position:absolute; top:520px; left:10px;" id="panel"> <td width="346" class="Questions"> </td> <td width="299"> </td> </tr> </table> <br> </cfform> </body> </html> I tried to use onclick, or change and probably iam missing something
This message was edited by asamuel on 3-12-04 @ 10:02 AM
|
saya |
03-16-2004 @ 11:00 PM |
|
|
New Member
Posts: 40
Joined: Oct 2003
|
Hi, From my understading, you need a "subimt" button. Here's the example: Form page: <form name="dmatrix" action="testaction.cfm?submit=yes" method="post"> <table width="84%" border="0" cellspacing="10" cellpadding="0"> <tr> <td colspan="2"><h2 align="center"><font color="#0000FF"><u>Driver Matrix form</u></font></h2></td> </tr> <tr> <td colspan="2"><h3><font color="#0000FF"><strong>Please supply us with all the information below about the <font size="5">ATD:</font></strong></font></h3></td> </tr> <tr> <td width="52%" class="Questions"><strong>Please define ATD Type?</strong></td> <td width="48%"><select name="atdtype" id="select"> <option>Please choose one</option> <option>Hybrid III 5th</option> <option>Hybrid III 50th</option> <option>Hybrid III 95th</option> <option>Hybrid III 6 Year old</option> <option>Hybrid III 3 Year old</option> <option>3 Year old airbag</option> <option>Sid IIS</option> <option>DOT SID</option> <option>BioSID</option> <option>EuroSID</option> <option>6 Month CRABI</option> <option>12 Month CRABI</option> <option>TNO 10</option> </select></td> </tr> <tr> <td class="Questions">Is there any instrumentation required?</td> <td><table width="69%" border="0" cellspacing="5" cellpadding="0"> <tr> <td width="34%"><input name="ReqInstru" type="radio" value="No" onClick="testno();"> <strong>No</strong></td> <td width="66%"><input type="radio" name="ReqInstru" value="Yes" onClick="testyes();"> <strong>Yes</strong></td> </tr> </table></td> </tr> </table> <div id="MMDIVpanel" style="visibility:hidden"> <table> <tr> <td id="test1"><div align="center"> <input name="instrument" type="radio" value="Autoliv"> <strong>Standard Instrumentation </strong> <input name="instrument" type="radio" value="custom"> <strong>Other Instrumentation</strong></div></td> </tr> </table> <input type="submit" value="submit"> </div> </form> Action Page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <cfif Isdefined ("url.submit")> <cfswitch expression="#form.instrument#"> <cfcase value="Autoliv"> <strong>Standard Instrumentation: </strong> <TABLE BORDER="2" CELLPADDING="0" CELLSPACING="1" BORDERCOLOR="#cc6699"> <TR> <TH><font color="#333399">Standard</font></TH> </TR> </table> </cfcase> <cfcase value="custom"> <strong>Other Instrumentation:</strong> <TABLE BORDER="2" CELLPADDING="0" CELLSPACING="1" BORDERCOLOR="#cc6699"> <TR> <TH><font color="#333399">Others</font></TH> </TR> </table> </cfcase> </cfswitch> </cfif> </body> </html> It works in my site. Hope it helps.
Kindest Regards, Saya
|
asamuel |
03-17-2004 @ 10:29 AM |
|
|
Junior Member
Posts: 79
Joined: Oct 2003
|
Thanks Saya, I see what you are talking about, I just tried it, and it is working, but i have two questions 1- each one in the select have different form or table so when for examlpe i click on SID in the select option and choose standard it will give me the proper table or form for this selection. 2- there is any way instead the action page have on the main page because this is part of the main page. I am really appreciate your help
|
saya |
03-17-2004 @ 7:45 PM |
|
|
New Member
Posts: 40
Joined: Oct 2003
|
Hi, Yes, it can. Example: Change the 'action="testaction.cfm"'(this is to action page) On the main page itself, change the 'action="test.cfm"' (use the main page file name) Then move the program from action page to main page. Example: </form> <cfif Isdefined ("url.submit")> <cfswitch expression="#form.instrument#"> <cfcase value="Autoliv"> <strong>Standard Instrumentation: </strong> <TABLE BORDER="2" CELLPADDING="0" CELLSPACING="1" BORDERCOLOR="#cc6699"> <TR> <TH><font color="#333399">Standard</font></TH> </TR> </table> </cfcase> <cfcase value="custom"> <strong>Other Instrumentation:</strong> <TABLE BORDER="2" CELLPADDING="0" CELLSPACING="1" BORDERCOLOR="#cc6699"> <TR> <TH><font color="#333399">Others</font></TH> </TR> </table> </cfcase> </cfswitch> </cfif>
Kindest Regards, Saya
|
asamuel |
03-18-2004 @ 2:53 PM |
|
|
Junior Member
Posts: 79
Joined: Oct 2003
|
Hi Saya, Now we solved the issue with the radio button, but when user click on the ATDtype selection, each option it has different standard and other instrumentation, so how can we do it so it depends on the selected option and the radio button will be relative to this so if i select first option and after that click on standard, it should give the standard for the selected item, I hope that you got what i am trying to do. Thanks,
|
saya |
03-18-2004 @ 6:51 PM |
|
|
New Member
Posts: 40
Joined: Oct 2003
|
Hi, Asamuel I can't figured out what you mean. Could you specific more details.
Kindest Regards, Saya
|
asamuel |
03-18-2004 @ 9:01 PM |
|
|
Junior Member
Posts: 79
Joined: Oct 2003
|
Hi saya, In my first post i have field in the form cold ATDType it is select field, and i have may be 10 option,and my whole discussion i want to get these selsction works with the radio button, so if user select from the ATDtype(select field)second choice, and select standard from the radio button, he or she should get the proper form or table for this choice and so on, so we don't have only one standard form and one other form for each choice in the select field has its own form.
|
saya |
03-18-2004 @ 11:03 PM |
|
|
New Member
Posts: 40
Joined: Oct 2003
|
Hi, Asamuel From your specific, I hope I get what you mean and here's the example: In the form Page you have to include the option value: <td width="48%"><select name="atdtype" id="select"> <option value=0 selected>Please choose one</option> <option value=1>Hybrid III 5th</option> <option value=2>Hybrid III 50th</option> <option value=3>Hybrid III 95th</option> And you also have to include the condition in the "CFSWITCH": <cfswitch expression="#form.instrument# and #form.atdtype#"> <cfcase value="Autoliv and 1"> <strong>Standard Instrumentation: </strong> <TABLE BORDER="2" CELLPADDING="0" CELLSPACING="1" BORDERCOLOR="#cc6699"> <TR> <TH><font color="#333399">Hybrid III 5th</font></TH> </TR> </table> </cfcase> <cfcase value="Autoliv and 2"> <strong>Standard Instrumentation: </strong> <TABLE BORDER="2" CELLPADDING="0" CELLSPACING="1" BORDERCOLOR="#cc6699"> <TR> <TH><font color="#333399">Hybrid III 50th</font></TH> </TR> </table> </cfcase> <cfcase value="custom and 1"> <strong>Other Instrumentation:</strong> <TABLE BORDER="2" CELLPADDING="0" CELLSPACING="1" BORDERCOLOR="#cc6699"> <TR> <TH><font color="#333399">Others Hybrid III 5th</font></TH> </TR> </table> </cfcase> <cfcase value="custom and 2"> <strong>Other Instrumentation:</strong> <TABLE BORDER="2" CELLPADDING="0" CELLSPACING="1" BORDERCOLOR="#cc6699"> <TR> <TH><font color="#333399">Others Hybrid III 5th</font></TH> </TR> </table> </cfcase> </cfswitch>
Kindest Regards, Saya
|
asamuel |
03-19-2004 @ 3:58 PM |
|
|
Junior Member
Posts: 79
Joined: Oct 2003
|
Hi Saya, It seems this what i want and i am looking for, but i have some trouble with it, like when i try to run it, it doesn't give anything empty page, i tried to run the action page only to see the tables i have and still the same thing, so what do you thing the problem is. Thanks,
|
saya |
03-20-2004 @ 12:24 AM |
|
|
New Member
Posts: 40
Joined: Oct 2003
|
Hi, Asamuel I'm not quite sure what your trouble is, maybe you can specify more details.
Kindest Regards, Saya
|