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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:06:22+00:00 2026-06-05T22:06:22+00:00

I have 2 input textfields and 4 radiobuttons. With a click on the submit

  • 0

I have 2 input textfields and 4 radiobuttons.
With a click on the submit button, I want these values to appear in the sidebar.
Because the visitor can only select one radio button, three value’s should be appearing in the sidebar: brand, price and one selected direction.

Unfortunately right now I’m getting an error:

“error”: “Please use POST request”

This is my code and jsFiddle:

HTML:

<h1>Adding an item</h1>
<form>
    <div>
        <input type="text" name="price" id="price" value="price" />
        <input type="text" name="brand" id="brand" value="brand"/> 
        <br/>
        <input type="radio" name="direction" value="up" />  UP
        <input type="radio" name="direction" value="down" /> DOWN
        <input type="radio" name="direction" value="left" />  LEFT
        <input type="radio" name="direction" value="right" /> RIGHT
        <button id="addbutton">add it</button>
      </div>
</form>

<div id="sidebar"><h1>sidebar</h1></div>

JS:

$('#addbutton').click(function() {
    var $addDiv = $('#sidebar');
    $addDiv.append($('#brand' + '#price').val());
});

http://jsfiddle.net/kHuYp/

My question to you is:
How can I also append the value of the selected radio button? And what do I have to change in my code to make the error go away? Thanks 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-06-05T22:06:24+00:00Added an answer on June 5, 2026 at 10:06 pm

    You need to treat each value independently in this line:

    $addDiv.append($('#brand' + '#price').val());
    

    Should be something like( depending on separator):

     $addDiv.append($('#brand').val() +' '+$('#price').val());
    

    To avoid form submitting, return false in your click handler

    DEMO: http://jsfiddle.net/kHuYp/3/

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

Sidebar

Related Questions

I have 4 input textfields, and a single textfield that should collect values from
I have input.txt and I want to search for a string and extract a
i have input xml as <content> <date> <day>14</day> <month>06</month> <year>2012</year> </date> </content> want it
I have 5 textfields for user input in a form namely: username1, username2, username3,
I have an HTML form with two input textfields. When the user tabs from
There is a webpage that has Input textfields. I want to launch the page
Familiar with creating textfields in a form like this example:- Name :<input type=text name=visitor
I have two textfields in HTML, when a button is clicked, I need to
can anybody help me in such situation: I have SigninController class with two textFields
I have 5 input text fields on 5 rows . where all 5 textfields

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.