Jump to content
  • Advertisement
Sign in to follow this  
benryves

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

This topic is 5084 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!