flyersun Posted February 10, 2007 Share Posted February 10, 2007 I asked about this a while ago didn't really get anywhere with the project. Now I've working on it again I've pretty much got the whole thin worked out in my head I only have one problem which I'm hoping to get some help with. Here's the problem. The site is a quotation system for a travel insurance company. I need the information on the form to change depending on what sort of trip is selected from a drop down menu. I know this is done using the on select java script fuction.. but I don't know where to go from there. I would normaly just go find the js on the web but I'm not even really sure what I'm looking for. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted February 10, 2007 Share Posted February 10, 2007 You want to research the HtmlDOM. There's two basics approach you can take: 1) You send all of the possible changes to the form in a single document as hidden page elements. As the drop down changes, you use the DOM to move the hidden elements into their visible positions on the page. How useful this approach is depends on how much dynamic content there is. If you're only talking about two hidden list boxes, each with 10 to 20 items, and based on another drop down selection one of them is displayed, this method is fine. If there's lots of possibilities of which dynamic information to display and there's a good chance most of it will never be displayed, you'll want to go with approach #2. 2) Use AJAX. There's an AJAX discussion area on these forums to help you out with this as well as useful information at the w3schools website. The basic concept is as the user interacts with the form, you use javascript to make requests to the server. Javascript on the page will be called when the server finishes the request and your page can process the results, such as inserting dynamic HTML elsewhere in the page. Typically, when the user changes a field you'd send their input to the server and the server would respond with possibly more form content; you then use the DOM to stick this content into your page. HtmlDOM http://www.w3schools.com/htmldom/default.asp Javascript http://www.w3schools.com/js/default.asp AJAX http://www.w3schools.com/ajax/default.asp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.