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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:56:05+00:00 2026-05-19T00:56:05+00:00

The Problem I have a page with a form on. It has a hidden

  • 0

The Problem

I have a page with a form on. It has a hidden field called: generic_portrait

I want the user to click a link “select portrait”

This will open a Dialog/Popup using jQuery, based on a dropdown completed earlier in the form. If the value of the dropdown called “gender” is “male” then show male options, if “gender” is set to “female” show female options.

Each portrait has a radio button, each with a name assigned “male1”, “male2” etc

Depending on the radio button selected in the popup, I want the hidden field to be set to match this.

The Questions

What is the best way to show a dialog/popup using jQuery, different depending on a dropdown box on the page. Use Javascript to see what is selected, then show a corresponding Div?

I can do the check to see what the dropdown is set to using jQuery, but how can I then shown a specific popup based on that?

Once i’ve popped it up, how do I take the value assigned to the selected radio box, and set the hidden field called “generic_portrait” to this value.

Why i’m asking

Normally I would figure this out myself, as i’m sure it’s not that difficult, but I don’t use Javascript and/or PHP very often, and this is due for a client urgently. So I would really, really appreciate some help on this one.

Thanks for all replies in advance.

  • 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-19T00:56:06+00:00Added an answer on May 19, 2026 at 12:56 am

    Moses has some good insight. But, to specifically answer your questions:

    • For the popup you need you might try using a “modal”. Check out the jQuery UI library and specifically look at the dialog widget.
    • As to how to show a different modal in each circumstance, one option would be to create an empty div element which is hidden by default via CSS. Then using the dialog widget, create a different modal for each. A basic example:$("#yourID").html("your content").dialog({title:"your title",show:"fade",hide:"fade",buttons:{Done:function(){$(this).dialog("destroy");}}}); NOTE: There are a number of ways to create the modal content, including creating them in full in the HTML, while being hidden, and then simply using the dialog widget to display them.
    • As to how to populate your hidden field with what was selected in the dialog widget, look at dialog widget source code (e.g. the “view source” link on the page) to see how they get form values. You can then use jQuery to set the hidden field’s value attribute.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I have an address field from an Access database which has been converted
I have JSF page has two drop down lists and I want to load
Here's the problem: 1.) We have page here... www.blah.com/mypage.html 2.) That page requests a
everybody; I have this problem in asp.net, I have a page where I insert
I have found a problem with use JQuery timeout, i have a page with
I have a problem where I cannot identify visitors to my intranet page because
OK, Here is my problem, I have a master page with a HEAD section
I have a asp.net page I'm writing and I'm perplexed by this problem. I
I want to preset the value of a selectbox based on a hidden field.
I have a jsp page which has different IF conditions.On load of the jsp

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.