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 9202583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:17:27+00:00 2026-06-17T23:17:27+00:00

My application takes user’s phone numbers as input and stores them in the database.

  • 0

My application takes user’s phone numbers as input and stores them in the database. On a separate page we ask the user to check those phone numbers that should be visible to other users. Please don’t ask any questions on why we are doing this as it is done for some business reasons that are irrelevant for this question.

Now, I am trying to display these phone numbers and ask the user to check those phone numbers that should be visible or uncheck the ones that he previously checked. I have the following open questions:

  1. When the user submits the form, I have no idea what his phone numbers are. How do I associate a check box with a phone number?
  2. If I use hidden fields, is it a standard practice to give these input fields, the phone number they correspond to as Id’s?
  • 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-06-17T23:17:29+00:00Added an answer on June 17, 2026 at 11:17 pm

    Assuming no phone numbers are repeated, the simplest way would be to set each checkbox’s value to its associated phone number:

    0262543210 <input type="checkbox" name="makeVisible" value="0262543210">
    0265511223 <input type="checkbox" name="makeVisible" value="0265511223">
    0398123456 <input type="checkbox" name="makeVisible" value="0398123456">
    

    (Obviously you’d add some sort of formatting, a table or an unordered list or something.)

    Then in your server-side code process each makeVisible (or whatever name you give it) value, bearing in mind that only the checked ones get submitted. No JavaScript is needed for this method.

    If you want to submit a yes/no or true/false (visible/hidden) value for every number the no-JS way is to just use radio buttons. But the easiest way with checkboxes is probably with a hidden field set based on the checkbox state:

    <table>
      <tr>
        <th>Phone Number</th>
        <th>Make visible?</th>
      </tr>
      <tr>
        <td>0262543210</tr>
        <td>
           <input type="hidden" name="number" value="0262543210">
           <input type="hidden" name="makeVisible">
           <input type="checkbox" class="numbervisibility">
        </td>
      </tr>
      <tr>
        <td>0265511223</tr>
        <td>
           <input type="hidden" name="number" value="0265511223">
           <input type="hidden" name="makeVisible">
           <input type="checkbox" class="numbervisibility">
        </td>
      </tr>
      <!-- etc. -->
    </table>
    

    Add additional hidden fields with record ids if required, or use record ids instead of the phone numbers – whatever is appropriate to your data structure.

    Then use some simple jQuery to set the hidden values when the checkbox changes:

    $(".numbervisibility").click(function() {
        $(this).closest("td").find('input[name="makeVisible"]').val(this.checked ? "Y" : "N");
    });
    

    That way server-side you’d end up with matched arrays of fields with the number and associated visibility setting.

    Note that if you’re using PHP you should name repeating fields with [] at the end, like "makeVisible[]".

    (Of course in either solution you’d use server-side code to inject the phone numbers into the html.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an ASP.NET application that takes user input and serializes them into
If I have a 3 layer web forms application that takes user input, I
The application I've been working on takes user input from a form, and builds
I have an ASP.NET web application that takes user input across several forms. Sort
I have a C++ console application that takes input from user by displaying a
I am trying to build a console application that takes user input. I was
I am building a blackberry application takes input from user then send input to
I am writing an application which takes text input from the user to generate
I am working on a application that takes user input in the form of
My application takes an input from the user. Some of the Asian user enter

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.