[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

building a multi-field search form in dreamweaver

Posted on 2002-04-30
4
Medium Priority
?
212 Views
Last Modified: 2012-05-04
Hi, I have a very little time to develop a new prototype and the results will have a heavy repercussion to the next stages of development on many of our next projects so I'd like to have your opinions on how to build this:

I'm building a search form in asp (javascript) with 5 dynamic lists using ultradev dreamweaver 5. A search result page will be built using the options selected in the form from that search page.

The problem is the following: each dynamic option list is supposed to update itself after any modification on another of these list is made. I suppose I'll have to put a "onChange" handler on my lists and call a javascript function that will execute the form's submit and recall that same page. Using my solution, I'll have to build 5 different record sets to dynamicly input the data in my lists. I wonder if there is a easier or more efficient way to do the job.

If my problem is not clear enough, I'll try to post more details...

Thank you in advance for your most needed advices...
0
Comment
Question by:Whistler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 9

Expert Comment

by:AlfaNoMore
ID: 6982866
OK, this is unproved and un-tested, but I'm putting it in here as a working idea....


<script language="javscript">
var allOptions = [];
allOptions[0]  = new selectObj('option 1');
allOptions[1]  = new selectObj('option 2');
allOptions[2]  = new selectObj('option 3');
allOptions[3]  = new selectObj('option 4');
allOptions[4]  = new selectObj('option 5');
allOptions[5]  = new selectObj('option 6');

allOptions[0].next[0]  = new selectObj('option 1.1');
allOptions[0].next[1]  = new selectObj('option 1.2');
allOptions[0].next[2]  = new selectObj('option 1.3');
allOptions[0].next[3]  = new selectObj('option 1.4');
allOptions[0].next[4]  = new selectObj('option 1.5');
allOptions[0].next[5]  = new selectObj('option 1.6');

allOptions[1].next[0]  = new selectObj('option 2.1');
allOptions[1].next[1]  = new selectObj('option 2.2');
allOptions[1].next[2]  = new selectObj('option 2.3');
allOptions[1].next[3]  = new selectObj('option 2.4');
allOptions[1].next[4]  = new selectObj('option 2.5');
allOptions[1].next[5]  = new selectObj('option 2.6');

allOptions[0].next[0].next[0]  = new selectObj('option 1.1.1');
allOptions[0].next[0].next[1]  = new selectObj('option 1.1.2');
allOptions[0].next[0].next[2]  = new selectObj('option 1.1.3');
allOptions[0].next[0].next[3]  = new selectObj('option 1.1.4');
allOptions[0].next[0].next[4]  = new selectObj('option 1.1.5');
allOptions[0].next[0].next[5]  = new selectObj('option 1.1.6');

function selectObj(value) {
    this.value = value;
    this.next  = [];
    return this;
}
   
</script>


More to follow ////
0
 
LVL 9

Accepted Solution

by:
AlfaNoMore earned 200 total points
ID: 6982889
<select name="level_1" onChange="updateFollowingSiblings(1);">
</select>

<select name="level_2" onChange="updateFollowingSiblings(2);">
</select>

<select name="level_3" onChange="updateFollowingSiblings(3);">
</select>


<script language="javascript">
function updateFollowingSiblings(level) {
   var execThis = 'allOptions';
   for(i=0; i<level; i++) {
      var thisSelect = document.forms[0]['level_' + (i + 1)];
      execThis += '[' + thisSelect.options.selectedIndex + ']';
   }
   var thisArray = exec(execThis);
   for(i=level; i<4; i++) {
      thisSelect = document.forms[0]['level_' + i];
      // clear the next select box...
      for(j=thisSelect.length; j>0; j--) {
         thisSelect[j] = null;
      }
      // before adding the new options.
      for(k=0; k<thisArray.length; k++) {
         thisSelect[0] = new option(thisArray[k].value, k);
      }
      thisArray = // need to merge all of the next level's into one array here. Not sure how to do this, so will have to leave this here! Sorry...
   }
}
</script>
0
 

Author Comment

by:Whistler
ID: 6983389
Thanks a lot!

I have some problems tough to implant your solution since I'm just fresh out of school. I'll do my best!
0
 
LVL 9

Expert Comment

by:AlfaNoMore
ID: 6983421
I'm sure you will run into problems with this. It's quite tricky to manage multiple relationships. I htink this multi-array based approach seems quite simple, but constructing the arrays will be quite messy!

Good luck with it though.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question