www.webdeveloper.com
Results 1 to 2 of 2

Thread: Javascript help - fields appear/disappear with tick box and interacting fields

  1. #1
    Join Date
    Jan 2013
    Posts
    1

    Javascript help - fields appear/disappear with tick box and interacting fields

    Hi I am a complete newbie so please go easy on me

    I want to create an HTML form for a calculation and I want use javascript to perform the actual calcualtion on a button click. There are two things I want it to do but do not know if it is possible:

    1. I want to have a gross annual salary field and a gross weekly field, I also want a net annual and net weekly field. because some people only know what their annual salary is and not there weekly I want it to automatically complete they one they do not fill in. So if someone puts in their gross annual salary I want the gross weekly salary to automatically complete with (gross annual divided by 52). But if they put in their gross weekly I want it to automatically fill in their gross annual (weekly times 52). Is this possible?

    2. The second thing I want is that some of the text fields are optional so I want it to say 'do you want to enter x' with a tick box next to it, if it is ticked then I want the relevant text box/number box to appear.

    Any help would be greatly appreciated Thank you

  2. #2
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,111
    Here's a basic example with jQuery:
    http://jsfiddle.net/3pdNf/5/
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles