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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:09:02+00:00 2026-06-14T18:09:02+00:00

I am trying to make a a form that will allow my to select

  • 0

I am trying to make a a form that will allow my to select a radio button that will change a button href location and open it in a javascript pop up. The JS for the href change that I have is:

<script type="text/javascript">
<!--
// return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function getCheckedValue(radioObj) {
if(!radioObj)
    return "";
var radioLength = radioObj.length;
if(radioLength == undefined)
    if(radioObj.checked)
        return radioObj.value;
    else
        return "";
for(var i = 0; i < radioLength; i++) {
    if(radioObj[i].checked) {
        return radioObj[i].value;
    }
}
return "";
}

// set the radio button with the given value as being checked
// do nothing if there are no radio buttons
// if the given value does not exist, all the radio buttons
// are reset to unchecked
function setCheckedValue(radioObj, newValue) {
if(!radioObj)
    return;
var radioLength = radioObj.length;
if(radioLength == undefined) {
    radioObj.checked = (radioObj.value == newValue.toString());
    return;
}
for(var i = 0; i < radioLength; i++) {
    radioObj[i].checked = false;
    if(radioObj[i].value == newValue.toString()) {
        radioObj[i].checked = true;
    }
}
}
//-->
</script>

The JS for the pop up is from Highslide JS (highslide.com)

the from code I have is:

 <form name="radioExampleForm" method="get" action="" onsubmit="return false;">
<p><label for="number0"><input type="radio" value="popups/download1.html" name="number"     id="number0"> Free</label>
&nbsp;<label for="number1"><input type="radio" value="popups/download2.html" name="number" id="number1">Premium</label>

<p>
<input type="button" onclick="return hs.htmlExpand(this, { objectType: 'iframe' } ); window.location.href = (getCheckedValue(document.forms['radioExampleForm'].elements['number']));" value="Download" class="button">
</form>

Is it possible to combine these, if so, what am I doing wrong? Both JS work just not when I combine them.

  • 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-14T18:09:04+00:00Added an answer on June 14, 2026 at 6:09 pm

    Highslide allows you to override the iframe src via the src property of its configuration object:

    hs.htmlExpand(this, {
        objectType: 'iframe',
        src: 'mypage.html'
    });
    

    As Joshua pointed out in your current code: return hs.htmlExpand .. will prevent your second statement (window.location ..) from executing. Even if it was to execute, all it would do is change the location of the current browser window to the target URL.

    A solution would look like this:

    <form name="radioExampleForm" method="get" action="" onsubmit="return false;">
        <p>
            <label for="number0"><input type="radio" value="popups/download1.html" name="number" id="number0"> Free</label>&nbsp;
            <label for="number1"><input type="radio" value="popups/download2.html" name="number" id="number1">Premium</label>
        <p>
    
        <input type="button" onclick="return hs.htmlExpand(this, { objectType: 'iframe', src: getCheckedValue(document.forms['radioExampleForm'].elements['number']) } );" value="Download" class="button">
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make an AJAX form that will update a twitter status when
I am trying to make a search form that will help users filter their
I'm trying to to make a form that will submit a new record and
I am trying to create a form page that will allow the end-user the
I'm trying to make a form that will take given text and direct you
Im trying to build a page that will allow a user to select a
Trying to make a custom :confirm message for a rails form that returns data
I am trying to make a form field for a datetime property that allows
I am trying to make a form using two drop down select menus: one
I'm fairly new to javascript and I'm trying to make an form for my

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.