Can This Be Done ?

Results 1 to 3 of 3

Thread: Can This Be Done ?

  1. #1
    Teddy Guest

    Default Can This Be Done ?

    Hello,<BR><BR>Im trying to develop some presentation code within my ASP document. I have the objectives defined but I dont know if what Im trying to do is even possible. Hopefully the following example were illustrate my intentions. If anyone has done this or knows how and can lend me guidance I will greatly appreciate it. Thanks in advance.<BR><BR>I need to have categories such as:<BR><BR>1. Model<BR>2. Engine<BR>3. Suspension<BR>4. Options<BR><BR>when one is clicked on (Engine here), it would expand to:<BR><BR>1. Model<BR>2. Engine<BR>Checkbox1 Checkbox2 Checkbox3 etc.<BR>3. Suspension<BR>4. Options<BR><BR>If another category is selected the expanded one would collapse and the new one would expand. My question is can this be accomplished without the ASP page calling itself. Im trying to keep the checkbox values by staying in the same page. If anyone has an alternative that accomplishes these things please respond.<BR><BR>Best regards,<BR><BR>Teddy<BR><BR> <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Can This Be Done ?

    Yes, you can do it with dhtml/javascript. This means it will run completely on the client side. Try entering the following into an .html page, and loading it in your browser.<BR><BR><BR>&#060;SCRIPT LANGUAGE="Javascript"&#062;<BR>var openElement;<BR><BR>function ExpandOrHide(objDivision)<BR>{ <BR> if ( == "none")<BR> {<BR> //Show it<BR> = "";<BR> <BR> if (typeof(openElement) == "object")<BR> {<BR> = "none";<BR> }<BR> openElement = objDivision;<BR> }<BR> else<BR> { //Hide It<BR> = "none";<BR> openElement = "";<BR> }<BR> <BR> window.event.cancelBubble = true;<BR>}<BR>&#060;/SCRIPT&#062;<BR><BR>&#060;P&#062;&#060;A NOHREF onclick="ExpandOrHide(cat1)"&#062;Show Category 1&#060;/A&#062;&#060;/P&#062;<BR>&#060;DIV ID=cat1 style="display:none"&#062;<BR>&#060;INPUT type="checkbox" id=checkbox3 name=checkbox3&#062;Product 1<BR>&#060;INPUT type="checkbox" id=checkbox4 name=checkbox4&#062;Product 2<BR>&#060;INPUT type="checkbox" id=checkbox5 name=checkbox5&#062;Product 3<BR>&#060;/DIV&#062;<BR><BR>&#060;P&#062;&#060;A NOHREF onclick="ExpandOrHide(cat2)"&#062;Show Category 2&#060;/A&#062;&#060;/P&#062;<BR>&#060;DIV ID=cat2 style="display:none"&#062;<BR>&#060;INPUT type="checkbox" id=checkbox7 name=checkbox7&#062;Product A<BR>&#060;INPUT type="checkbox" id=checkbox8 name=checkbox8&#062;Product B<BR>&#060;INPUT type="checkbox" id=checkbox9 name=checkbox9&#062;Product C<BR>&#060;/DIV&#062;

  3. #3
    Join Date
    Dec 1969

    Default RE: Can This Be Done ?

    I did something similar to this using JavaScript without having to recall the page. I don&#039t think it is really close enough to what you are asking to help directly, but it may give you an idea. I am building drop down(SELECT) boxes on the fly based on what the user selects in the higher level dropdown box. The highest level SELECT is defined in the HTML and uses onChange= to go to a JavaScript function when the user clicks on one of the Options in that select box. The lower level SELECTs are built with no OPTIONs by the HTML, but are then populated in the JavaScript functions. The secondary dropdown boxes are populated the first time by going to the JavaScript functions via onLoad= in the BODY statement. Every SELECT statement except the lowest level has on onChange= to take it to a function the build the next lower level. This is a simplistic outline, but may get your thought processes started.<BR> Having said the above, the bad news is that I had several problems with the above approach when testing with a Netscape browser. I managed to solve most, but not all of them and eventually had to just say, "This page requires Internet Explorer".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts