Need help with html - using 2.0

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello Friends,
    I have a drop down with 5 values in it and the drop down has the
below values

year, make, model
Date range of grounded date
customer last name and account number

Based on what the user selects a seperate a different user interface
should be displayed.

So keeping that in mind I have difined 4 Panels and put all their
visible property to False in .aspx page. and I am handlign the hiding
and display part base on the selection in the codebehind page.

This is how my table with the panels in the html page looks like

   <tr><td> Panel1 for vin</td></tr>
   <tr><td> Panel2 for year, make, model</td></tr>
   <tr><td> Panel3 for Date range of grounded date</td></tr>
   <tr><td> Panel4 for customer last name and account number</td></tr>

But as its obivious I see a space of a particular panel is hiddern. I
mean If I select lastname, and account number in the drop down the page
displays space (as there 3 rows above the my selection). and also When
I select Year, make, model for some reason it doesn't display the model
text box and I only can Year and make labels and textboxes!

Is there a different to handle with hiding and unhiding panels? I have
no clue what a Div tag does if it could do a miracle.

Can any body help me with this.


Re: Need help with html - using 2.0

Learner wrote:

Quoted text here. Click to load it

There are a few ways to do this.

One (the old way) would re-submit the page whenever they change the
drop-down. The user interface is now built from scratch in your ASP
page and then returned. You don't need to make anything "visible" or
"invisible", just change whether it's there at all.

The modern way is with AJAX, where the whole interface would be sent in
one piece, then things happen (in JavaScript)  as the user changes the
drop-down. You might also submit the user's changes to each pane
separately, without needing to submit the whole page. Try reading any
of the many AJAX books and tutorials around now (Ajax in Action is
good). Avoid anything mentioning "Atlas" though, especially on ASP.NET

Your approach is somewhere in the middle. You send the whole page, but
you allow bits to hide and display, depending on the drop-down. This is
sometimes useful, but ask first if it's not just easier to have a
larger page and scroll it.

As to the specifics of your question, then use a fragment like this:

document.getElementById ('unwantedpane').style.display = 'none';
document.getElementById ('wantedpane').style.display = '';

I suggest you post to comp.lang.javascript too

Site Timeline