Sign in to follow this  

[web] Hiding/Showing parts of a form (JavaScript)

This topic is 4867 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to hide/show parts of a form as you're working? I'm constructing an expenses form, and it'll look a bit like this:
Name [____v] Date [../../..][v]
-------------------------------
Type:  Amount:  VAT:
[___v] [______] (.) No VAT / ( ) VAT: [_____] Reference [_____]
[___v] [______] (.) No VAT / ( ) VAT: [_____] Reference [_____]
[___v] [______] (.) No VAT / ( ) VAT: [_____] Reference [_____]
[___v] [______] (.) No VAT / ( ) VAT: [_____] Reference [_____]
[___v] [______] (.) No VAT / ( ) VAT: [_____] Reference [_____]
---------------------------------------------------------------
                                                       [Submit]
Fear the ASCII [grin] The idea is to only show the top one of those lines, and when you start editing it it'll add the next one in. You can then submit the form, but if you click into the next line it'll add another underneath, a bit like this:
Name [____v] Date [../../..][v]
-------------------------------
Type:  Amount:  VAT:
[AB_v] [£12345] (.) No VAT / ( ) VAT: [_____] Reference [_____]
[DE_v] [£12.23] ( ) No VAT / (.) VAT: [£1231] Reference [ABCDE]
[___v] [______] (.) No VAT / ( ) VAT: [_____] Reference [_____]
---------------------------------------------------------------
                                                       [Submit]
Any bright ideas? Entering any text in the third line would add a fourth and so on.

Share this post


Link to post
Share on other sites

This topic is 4867 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this