Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Making One Selection List Dictate Another's Contents


  • From: javascript@xxxxxxxxxx (Daniel G. Augustine)
  • Subject: [Javascript] Making One Selection List Dictate Another's Contents
  • Date: Tue, 16 Apr 2002 15:21:09 -0400

This is a multi-part message in MIME format.

------=_NextPart_000_0000_01C1E55A.561C5800
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Trey,

I tried implementing your strategy into my application, but to no avail.  I
get an error when i load the file.  I have attached the 2 files that i
modified to use the same idea that bo.html and box2.html did.  any help you
could give would be great...ive been trying many different approaches to
this problem...thanks in advance

Dan





-----Original Message-----
From: javascript-admin@xxxxxxxxxx [mailto:javascript-admin@xxxxxxxxxx]On
Behalf Of Trey H
Sent: Friday, April 12, 2002 6:41 PM
To: javascript@xxxxxxxxxx
Subject: Re: [Javascript] Making One Selection List Dictate Another's
Contents


I am sorry, the attachments were lost on this last email for some reason.  I
will try again.  I hope the attachments are there.  They should be box.html
and box2.html  They may appear at the bottom of this email depending on your
email provider.


>From: "Trey H" <tutwabee@xxxxxxxxxxx>
>Reply-To: javascript@xxxxxxxxxx
>To: javascript@xxxxxxxxxx
>Subject: Re: [Javascript] Making One Selection List Dictate Another's
>Contents
>Date: Fri, 12 Apr 2002 22:36:47 +0000
>
>I have found one solution, but it is a little strange.  My solution
>involves
>making 2 identical pages exept that one variable is different.  That
>variable contains the other pages location.  I would have used one page,
>but
>it didn't work for some reason.
>
>First, change the box.html to what you would like it to look like.  Then
>copy the whole source code to the box2.html file.  In the box2.html file
>make sure the sloc variable contains "box.html".
>
>When you change the parent select box on the box.html page it goes to
>box2.html and changes the child select box accordingly.  This sure works
>visa-versa also.  You may need some more help because the values of other
>input fields in forms don't stay the same as what the user made them.  I
>can
>easily help you with this, but I need to know what your input fields names
>are and I need a rough copy of your page.
>
>====================================
>Trey: tutwabee@xxxxxxxxxxx
>Get free JavaScripts at the Blue Dragon!
>Just go to:
>http://www.websiter.biz
>====================================
>Make money by being online:
>http://www.degoo.com/index.php?refid=tutwabee
>===================================
>Earn free traffic for your website easily:
>http://tools.addme.com/servlet/popview?id=52260
>====================================
>
>
>
>>From: "Daniel G. Augustine" <daugustine@xxxxxxxxxx>
>>Reply-To: javascript@xxxxxxxxxx
>>To: <javascript@xxxxxxxxxx>
>>Subject: [Javascript] Making One Selection List Dictate Another's Contents
>>Date: Fri, 12 Apr 2002 13:23:55 -0400
>>
>>
>>Hey all,
>>
>>i am still relatively new to javascripting.  There has to be a way to do
>>what i want, i just cant figure it out, so im truing to you guys...I want
>>to
>>have 2 selection lists on my page, one of which is the "father" list and
>>the
>>other is the "child" list.
>>
>>When a user would select one choice from the first list (father list) the
>>script would populate the options for the child list based on the first
>>lists's choice.  For example, I have A, B, C, and D in the first list and
>>the second list is disabled (i have the code for that all taken care of)
>>until one of those A, B, C or D choices is made.  Lets say B is chosen.
>>After B is chose, Cat and Dog show up in the child list.  Or, I choose D
>>from the father list and then Snake and Rabbit show up in the "child"
>>list.
>>
>>Note:  This is just an example of how to do this...i mainly just want to
>>have control over making the user select a choce form the father list, and
>>then haveing a child list enabled with the contents of that child list
>>specific to what was chosen in the father list.  Anyway to do this would
>>be
>>fine...
>>
>>ALSO...VERY IMPORTANT...this application is being developed for use with
>>Pocket PC's, which means Internet Explorer CE, which in turn means, NO
>>Dynamic functions or DHTML supported...i wish i could use it, but i cant!
>>any way to do this???
>>
>>
>>Thanks in advance for the help.
>>
>>Dan
>>
>>__________________________________________________________________________
__
>>_
>>
>>Daniel G. Augustine
>>Intern
>>RLW, Inc.
>>(814) 867-5122
>>(717)-314-6052 (mobile)
>>
>>Pennsylvania State University
>>Undergraduate Student
>>School of Information Sciences and Technology
>>http://ist.psu.edu
>>
>>_______________________________________________
>>Javascript mailing list
>>Javascript@xxxxxxxxxx
>>https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
>
>_______________________________________________
>Javascript mailing list
>Javascript@xxxxxxxxxx
>https://lists.LaTech.edu/mailman/listinfo/javascript




====================================
Trey: tutwabee@xxxxxxxxxxx
Get free JavaScripts at the Blue Dragon!
Just go to:
http://www.websiter.biz
====================================
Make money by being online:
http://www.degoo.com/index.php?refid=tutwabee
===================================
Earn free traffic for your website easily:
http://tools.addme.com/servlet/popview?id=52260
====================================


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

------=_NextPart_000_0000_01C1E55A.561C5800
Content-Type: application/octet-stream;
	name="box2.asp"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="box2.asp"



<!--#include file=header.inc-->

<%
  $Response->{FormFill} = 1;
%>


<form name="input" METHOD="post">
<P ALIGN="CENTER">Compartment
<select name="Compartments" onChange="sChange()">
     <OPTION VALUE="0">none     
     <OPTION VALUE="compart1">compart 1</option>
     <OPTION VALUE="compart2">compart 2</option>
     <OPTION VALUE="compart3">compart 3</option>
</select>
</p>

<P ALIGN="CENTER">&nbsp;&nbsp;&nbsp;&nbsp;Machine&nbsp;&nbsp;&nbsp;&nbsp;
<SELECT NAME="Machines">
<script>
<!--

if(aft=="compart1") {
document.write('<option value="1">Machine 1');  
document.write('<option value="2">Machine 2');
}
if(aft=="compart2") {
document.write('<option value="3">Machine 3');
document.write('<option value="4">Machine 4');
}
if(aft=="compart3") {
document.write('<option value="5">Machine 5');
document.write('<option value="6">Machine 6');
}

// -->
</script>
</select>
</P>

<P ALIGN="CENTER">
<TEXTAREA COLS=25 ROWS=4 WRAP="hard" NAME="feedback">
</TEXTAREA>
</P>
<P ALIGN="CENTER">
     <INPUT TYPE="submit">
     <INPUT TYPE="reset">
</P>
</FORM>


<% #----The Following will print the info to the file----#

if ($Request->Form('feedback'))
{
  my $filename = "$TmpDir/notes.txt";
  open(FILE, ">>$filename") || die("Can't open file for writing: $!");
  flock(FILE, LOCK_EX);

  my $user = "Demo Demoson";
  my $url = "Note3.asp";
  my $realtime = gmtime();
  my $compartnum = $Request->Form('Compartments');
  my $machinenum = $Request->Form('Machines');
  my $feedbk = $Request->Form('feedback');

  print FILE "- Message Logged by: $user\n";
  print FILE "- $realtime\n";
  print FILE "- Compartment #$compartnum\n";
  print FILE "- Machine #$machinenum\n\n";
  print FILE "$feedbk\n\n";
  flock(FILE, LOCK_UN);
  close FILE;

  $Response->Redirect($url);

} #----The preceding will print the info to the file----#

%>

<!--#include file=footer.inc-->

------=_NextPart_000_0000_01C1E55A.561C5800
Content-Type: application/octet-stream;
	name="box.asp"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="box.asp"

<%
#####h# Note.asp
#
#   NAME
#       Note.asp
#
#    $Id: Note.asp,v 1.5 2002/04/12 17:32:09 daugusti Exp $
#
#   COPYRIGHT
#       (c) 2000-2001 RLW Inc.
#           All Rights Reserved. Redistribution and/or derivative
#           works are NOT permitted without prior consent.
#
#   DESCRIPTION
#
######
    $Demo::icon_file = "icons/Logo1.jpg";
    $Demo::title = "USS OSCAR AUSTIN DDG 79";
    $Demo::sub_title = "Watchstander Notes";

 
%>

<!--#include file=header1.inc-->

<%
  $Response->{FormFill} = 1;
%>


<form name="input" METHOD="post">
<P ALIGN="CENTER">Compartment
<select name="Compartments" onChange="sChange()">
     <OPTION VALUE="0">none     
     <OPTION VALUE="compart1">compart 1</option>
     <OPTION VALUE="compart2">compart 2</option>
     <OPTION VALUE="compart3">compart 3</option>
</select>
</p>

<P ALIGN="CENTER">&nbsp;&nbsp;&nbsp;&nbsp;Machine&nbsp;&nbsp;&nbsp;&nbsp;
<SELECT NAME="Machines">
<script>
<!--

if(aft=="compart1") {
document.write('<option value="1">Machine 1');  
document.write('<option value="2">Machine 2');
}
if(aft=="compart2") {
document.write('<option value="3">Machine 3');
document.write('<option value="4">Machine 4');
}
if(aft=="compart3") {
document.write('<option value="5">Machine 5');
document.write('<option value="6">Machine 6');
}

// -->
</script>
</select>
</P>

<P ALIGN="CENTER">
<TEXTAREA COLS=25 ROWS=4 WRAP="hard" NAME="feedback">
</TEXTAREA>
</P>
<P ALIGN="CENTER">
     <INPUT TYPE="submit">
     <INPUT TYPE="reset">
</P>
</FORM>


<% #----The Following will print the info to the file----#

if ($Request->Form('feedback'))
{
  my $filename = "$TmpDir/notes.txt";
  open(FILE, ">>$filename") || die("Can't open file for writing: $!");
  flock(FILE, LOCK_EX);

  my $user = "Demo Demoson";
  my $url = "Note3.asp";
  my $realtime = gmtime();
  my $compartnum = $Request->Form('Compartments');
  my $machinenum = $Request->Form('Machines');
  my $feedbk = $Request->Form('feedback');

  print FILE "- Message Logged by: $user\n";
  print FILE "- $realtime\n";
  print FILE "- Compartment #$compartnum\n";
  print FILE "- Machine #$machinenum\n\n";
  print FILE "$feedbk\n\n";
  flock(FILE, LOCK_UN);
  close FILE;

  $Response->Redirect($url);

} #----The preceding will print the info to the file----#

%>

<!--#include file=footer.inc-->

------=_NextPart_000_0000_01C1E55A.561C5800--