Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1034795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:26:52+00:00 2026-05-16T14:26:52+00:00

I got the New user form. There are three different clearence levels: client clientContact

  • 0

I got the “New user form”. There are three different clearence levels:

  • client
  • clientContact
  • clientRepresentative

And there are some fields, like newMail, newPostalCode, etc.

Here is a code I am using to show an element:

function doShow(obj) {
                    document.getElementById(obj).style.display = '';
                }

And a code I am using to hide an element:

function doHide(obj) {
                    document.getElementById(obj).style.display = 'none';
                }

It works for small blocks of data. While creating an user, the clearence level is specified, if it is clientRepresentative the appropriate field is being shown.
In example, client has only one e-mail adress, clientRepresentative has two e-mail addresses and clientContact has three.

But this don’t work!.
If I choose client, there is one e-mail, just as planned, but if I choose clientContact and then switch to clientRepresentative the redundant field (e-mail3) is not being hidden.

I believe this is a JavaScript issue, please help me, since my anger level hits the ceiling.

edit:
I forgot to paste function used to show/hide the items.

 if (clearenceLevel != "Chose...") {
                        if (clearenceLevel == "client") {

                            doShow("newMail");
                            doHide("newMail2");
                            doHide("newMail3");
                            doShow("newNip");
                            doShow("newRegon");
                            doShow("newStreet");
                            doHide("newHeadquarters");
                            doShow("newAddress");
                            doShow("newPostalCode");
                            doShow("kptekst");
                            doShow("newCity");
                            doShow("newAccount");
                            doShow("newState");
                            doHide("newStatus");
                            doHide("newPassword");
                        } else if (clearenceLevel == "clientRepresentative") {

                            doShow("newMail");
                            doShow("newMail2");
                            doHide("newStatus");
                            doHide("newMail3");
                            doHide("newNip");
                            doHide("newRegon");
                            doHide("newStreet");
                            doHide("newHeadquarters");
                            doHide("newAddress");
                            doHide("newPostalCode");
                            doHide("newCity");
                            doHide("newAccount");
                            doHide("newState");
                            doHide("kptekst");
                            doShow("newPassword");

                        } else if (clearenceLevel == "clientContact") {

                            doShow("newMail");
                            doShow("newMail2");
                            doShow("newMail3");
                            doHide("newNip");
                            doHide("newRegon");
                            doHide("newStatus");
                            doHide("newStreet");
                            doHide("newHeadquarters");
                            doHide("newAddress");
                            doHide("newPostalCode");
                            doHide("newCity");
                            doHide("newAccount");
                            doHide("newState");
                            doHide("kptekst");
                            doHide("newPassword");
                        }
                    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:26:53+00:00Added an answer on May 16, 2026 at 2:26 pm

    Not a direct answer to your question, but a suggestion on how you could improve the way that you’re doing this. Instead of having to list each property to display and hide for each user level, do something like:

    <input type="text" name="email" class="client representative contact">
    <input type="text" name="ssn" class="representative">
    

    Then when the user level changes hide everything and then unhide everything that has the correct level. So in my example “email” is available to “client” “representative” and “contact”. So if they switched to any of those levels, this field would display, however “ssn” is only available to “representative” so it wouldn’t display for anyone else.

    The advantage of this would be the ability to easily add a brand new item without needing to modify the Javascript, only the HTML.

    if (clearenceLevel != "Chose...") {
                        hideAll();
                        if (clearenceLevel == "client") {
                            doShow("client");
                        } else if (clearenceLevel == "clientRepresentative") {
                            doShow("representative");
                        } else if (clearenceLevel == "clientContact") {
                            doShow("contact");
                        }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a User model with three fields, :email, :display_name and :handle. Handle is
I have got a form which a user can use to create a new
I've got a web page where the user can add a new item to
I've got a form that allows the user to edit an employees information: name,
I would like to create user in my user table when new user have
I’ve got some a basic framework for a webapp (some static pages, user authentication,
I've got an asp.net web form, there is an update panel that contains a
I've got Windows Forms project. There's a textBox on the form, called txt. The
I've got an ASP.NET page with a simple form. The user fills out the
I have created new user 'testUser' in Dynamics GP company lets say 'TWO', there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.