PDA

View Full Version : javascript coding guru help needed



smartduckie
01-19-2007, 06:03 AM
I'm designing a dynamic webform for my company. what i need is that when you click on the dropdown box, for example, users choose 1, 2, 3,

it will show the different fill in fields. If you go to www.globalreviews.com.au/rsvp.asp page, you will see one question asks: how many? i'd like when users select one, it will only ask to fill in one guest's details, if users select two, it will ask to fill in two guest's details, if three, it will ask for three guest's details...

I'd really appreciated if someone can help me out.

tech_support
01-19-2007, 06:23 AM
http://www.dynamicdrive.com/dynamicindex16/formdependency.htm

parijaatp
01-19-2007, 11:53 AM
Hi,

I am sorry to point this out, and though you have achieved what you wanted, I just found a little bug while I was viewing the website,

when you have clicked on '4' and return to selecting less users the details field do not disappear. Also after you select more than '1' guests and revert back to selecting 'no', only one set of field disappear.

Thought this will help you.

smartduckie
01-21-2007, 07:11 AM
Hi,

I am sorry to point this out, and though you have achieved what you wanted, I just found a little bug while I was viewing the website,

when you have clicked on '4' and return to selecting less users the details field do not disappear. Also after you select more than '1' guests and revert back to selecting 'no', only one set of field disappear.

Thought this will help you.


actually I know this bug, and trying to fix it up, but didn't succeed. Could you kindly to help me out?

Cuchulainn
01-23-2007, 05:08 PM
1) CSS (!!!) use it! onmouseover and onmouseout can be replaced with :hover sub-class. macros are cool but CSS is the in-thing to do nowadays, i think.

2) Select 4 guests right away from 1, means the default view for 2 and 3 are still false. So you need to add some calls to display('2',true)etc. for 3 and 4. 1 and 2 get away with it cause you never hide 1.

personally, I would aim for a function that shows/hides similarly named divs based on a number & the common part of the names ( id="forms1",id="forms2",..., onclick="display(forms,#)" ).