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

  • Home
  • SEARCH
  • 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 7077045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:22:27+00:00 2026-05-28T06:22:27+00:00

Ok found some great code on Stack. Have adapted it slightly. But in essence

  • 0

Ok found some great code on Stack. Have adapted it slightly.

But in essence we have a radio box group, in a form. And onclick of one of these radio buttons, an input field is displayed.

I need to show this input field on a new line ( preferably with a new label too ) but struggling.

The code is: html

<div class="s_row_2 clearfix">
        <label><strong>Price</strong></label>
            <div class="s_full">
                <label class="s_radio"><input type="radio" checked="checked" name="r" id="r1" onchange="disableTxt()"/> Free</label>
                <label class="s_radio"><input type="radio" name="r" id="r2" onchange="disableTxt()"/> Swap / Trade</label>
                <label class="s_radio"><input type="radio" name="r" id="r3" onchange="disableTxt()"/> Lets Talk</label>
                <label class="s_radio"><input type="radio" name="r" id="r3" onchange="enableTxt()"/> Price</label>
                    <input type="text" name="r" id="price" style="display:none;width:212px;" size="30" placeholder="Type your price"/>
            </div>
    </div>

js:

var temp = '';
    function disableTxt() {
        var field = document.getElementById("price");
        if(field.value != '') {
            temp = field.value;
        }
        field.style.display = "none";
        field.value = '';
    }
    function enableTxt() {
        document.getElementById("price").style.display = "inline";
        document.getElementById("price").value = temp;
    }

Fiddle: http://jsfiddle.net/ozzy/mnxRr/

Essentially, I would prefer price as the first option. So that onclick the input field displays below the radio selections with a new label.

Any suggestions please

to recap sorry:

I prefer html like so:

<div class="s_full">
                <label class="s_radio"><input type="radio" name="r" id="r3" onchange="enableTxt()"/> Price</label>
                    <input type="text" name="r" id="price" style="display:none;width:212px;" size="30" placeholder="Type your price"/>
                <label class="s_radio"><input type="radio" checked="checked" name="r" id="r1" onchange="disableTxt()"/> Free</label>
                <label class="s_radio"><input type="radio" name="r" id="r2" onchange="disableTxt()"/> Swap / Trade</label>
                <label class="s_radio"><input type="radio" name="r" id="r3" onchange="disableTxt()"/> Lets Talk</label>
            </div>
  • 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-28T06:22:28+00:00Added an answer on May 28, 2026 at 6:22 am

    Why don’t you simply reorder your radio buttons?

    <div class="s_full">
        <label class="s_radio"><input type="radio" name="r" id="r3" onchange="enableTxt()"/> Price</label>
        <label class="s_radio"><input type="radio" checked="checked" name="r" id="r1" onchange="disableTxt()"/> Free</label>
        <label class="s_radio"><input type="radio" name="r" id="r2" onchange="disableTxt()"/> Swap / Trade</label>
        <label class="s_radio"><input type="radio" name="r" id="r3" onchange="disableTxt()"/> Lets Talk</label><br />
        <input type="text" name="r" id="price" style="display:none;width:212px;" size="30" placeholder="Type your price"/>
    </div>
    

    seems to do the trick, doesn’t it?

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

Sidebar

Related Questions

I found some great sql code for dynamic sort & order but I am
I have done some research prior to and have found some great articles but
I have some code which I found online and it's working great. It lists
Found some old code, circa VS 2003. Now I have just VS 2008 (SP1)
I have found some in the Cappuccino website (vim, textmate and SubEthaEdit), but not
I have found some info on the subject ( like this link) , but
I found this great code here the Demo . I just need some change.
I found some great code that is a subclass of UIView which draws that
I found some great example code some months ago to add a compose button
I found some jQuery code online for the jQuery Dialog and it works great.

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.