Using Radio Button To Change Another Input Value

Mar 9, 2011

I'm trying to use an onclick function in a radio button to change the value of a hidden input in another form. What I want to happen is, when the user changes the value of the radio button (0 or 1), the value of the input named 'repeat' is set to 0 or 1 accordingly. The goal being that when I submit the form with input name='repeat' it will send the number indicated by the radio button.(Due to the structure of my page the radio button and the hidden input need to be two separate forms.

View 1 Replies


ADVERTISEMENT

Set Radio Button From Textbox Input

Jul 20, 2005

I have a form where I need to set the radio button according to the
user's input. For example, if the user enters 21 or greater, I need the
adult radio button to be ticked. If the user enters 0-20, I need the
minor radio button to be ticked. Here's my code and I'm sure it's not
right. Please help.

<script language="JavaScript">
<!--
function AdultCheck() {
if (document.form1.AGE.value >= 21) {
document.form1.adult.value.checked = true
} else {
document.form1.minor.value.checked = true
}
}
//-->
</script>

View 1 Replies View Related

Dynamic Radio Button Input ?

Sep 9, 2009

The problem is with 3 radio buttons - each of which changes the view of the current page by passing parameters to the end of the page url.

CODE:

Is this even the most efficient way of doing this? I feel like there must be a better way.

View 3 Replies View Related

Select Radio Button When Text Input Has A Value?

Jun 3, 2011

I have been trying to figure out this seemingly easy function and have not had any luck.

Anyways, I have a form with a list of radio buttons, and one of them has a "select your own" or "custom" text entry.

<input type="radio" name="text" value="1" checked /> 0
<input type="radio" name="text" value="2" /> 1
<input type="radio" name="text" value="3" /> 2

[Code].....

Essentially, whenever a user either clicks in the text input or starts typing in the input, I would like the radio button to be selected. As of now, if you open the page and click on the text field, the default 'checked' radio button still is checked.

Does anyone know of a simple "onclick" event or something similar to accomplish this?

View 8 Replies View Related

JQuery :: Remove Input Attr From Radio Button

Jun 13, 2010

I have a form with several radio buttons in one fieldset (fieldset's are broke up by a wizard plug in). If you check "Yes" to any of the 5 radio buttons, all the parent li's with the radio buttons are hidden and a li with text appears stating you can't click yes. There is a link in there to go back to the original fieldset that when clicked, makes the li with text disappear and the li's with radio buttons appear. Easy enough to make this happen. When you click the link to go back I would like the radio buttons value reset, currently it is still on Yes.

View 1 Replies View Related

Display/Hide DIV Based On Radio Button Input?

Dec 1, 2009

I'm fairly new to Javascript and would be grateful for any help you can give me. I've had a search on Google and found a couple of potential solutions but nothing seems to work quite right for what I need.

Basically I have a form with several questions followed by Yes/No radio buttons. Dependent on which answer is given, I want to display a different message above the text box.

For example, if you answered 'no' to a certain question then the message above the text box would change to say "Please fill in additional information" or something along those lines.

[Code]...

View 3 Replies View Related

Radio Button Input Value Determines Which Form To Process

Oct 19, 2007

I have a successful php-based login screen for users. There are two radio buttons the user can select.

1) Login into Account Page (on my server).
2) Login into Affiliated Page (not on my server -- another website).

Now by default the radio button for the Account Page is selected. My question is, if the user selects the second radio button, how do I tell the form to now process the username/password for the affiliated site?

Currently, the action attribute in the form tag is set to "process.php" when the first radio button, Account Page, is selected. No big deal there.

But when they click the second radio button, I need the action attribute to process on the affiliated website by sending the username and password to this page: "http://www.affiliatepage.com/process.aspx"

So the issue is how does the login page know which form action to take?

Do I need to create two forms? If so, should the form for the Affiliate Page login be hidden? Code:

View 3 Replies View Related

JQuery :: Radio Button On Change?

Oct 28, 2011

I have 2 radio buttons.. when i select radio button need to hide div..

Here is my code

[Code]...

View 2 Replies View Related

Resolved Change Radio Button Value

Nov 25, 2010

I want to change radio button values dependent on the selected item in a drop down list.The radio buttons have default values but I need them to be changed when the selection has been made in the drop down list and before the submit button has been pressed so the changed values will be written to the database.

View 2 Replies View Related

Change Radio Button Value From Textbox Value

Mar 11, 2011

I Should have the textbox value as my radio button value. For example, if I type "5" in the textbox, then the radio button value would change to "5". by the way I have three radio buttons and one textbox and if I select one of those and type something in the text box the value would replace to radio button which is selected and all this have to happen before the page submitted or in the process of submitting. I hope I could find answers here (It's so important for me to solve this problem, For see the form please go to this page URL..., Its above the news frame where you can see three radio buttons and one textbox named shipment tracking.

View 12 Replies View Related

Radio Button Onclick Change Url?

Nov 20, 2009

I have a radiobutton set of 2 radiobuttons... I want to be able to change url if the radiobuttons are checked. How do I go about that.I have figured out that I need to use the onClick handler, but cant firgure out how to change the url..

View 2 Replies View Related

JQuery :: Change Img On Toggle Radio Button?

Mar 8, 2010

I wanted to modify an img src tag with a radio button. I tried the following below, with no luck.Not sure I'm doing it right.

[Code]...

View 6 Replies View Related

Dynamically Change Text In A Radio Button

Oct 12, 2007

I'm trying to write a Javascript quiz. The idea being that each question has 4 possible answers. The answers being in the form of multiple choice radio button. Instead of having either a long list of radio buttons and questions or loads of pages with tons of duplicated code, I'd like to make the quiz as one page. Pulling the questions, and possible answers from an array. All this I can do, except for changing the text on the radio buttons. In the past I've used.. getElementById with regular text to good effect, but can't manage it with the radio button. Here is part of my test code..

[Code]...

View 11 Replies View Related

Radio Button To Change Drop Down Menu?

Oct 12, 2007

Lets say you have a group of radio buttons with values of A, B, and C

I want to have a drop down box, on the same page that the values are changed by which radio button is selected

so if radio value A is selected then the drop down will have values of f1, x2, i3 if radio value B is selected then drop down will have values m1, r4, g3 and so on and so forth.

View 14 Replies View Related

Change Div Background When Radio Button Is Checked

Jan 21, 2010

Pleas how can i change div bg color with active chcecked radio button [code]if checked, change color from #fff to #ccc [code]

View 6 Replies View Related

JQuery :: Adding Checkbox/radio Button Values To An Input For Xml String ?

Jul 1, 2010

I can't seem to get this working correctly. I have several radio buttons and checkboxes. Based on them being checked I need to add that value to an input (which will be hidden) to be passed as a form parameter. The input they are added to is wrapped in xml tags. Currently it is simply overwriting each value, not adding them to the string. One value "IKNTK" needs to be passed regardless.

View 3 Replies View Related

Passing Form Value - Display The Value Of The Chosen Radio Button On A Text Input

May 11, 2010

I wrote this form to try to display the value of the chosen radio button on a text input.

<form>
Choose one choice...
<input type="radio" name="group1" value="5">Five<br>
<input type="radio" name="group1" value="10">Ten<br>
<input type="button" value="Get Result!" onClick="T1.value=group1.value"><br>
[Code]...

How come the onClick="T1.value=group1.value" results in undefined instead of 5 (or 10) ?

View 1 Replies View Related

JQuery :: Change Form On Click Of Appropriate Radio Button

Nov 3, 2011

I am new to jQuery. I want to change the form on click of the appropriate radio button.

This is my code
<s:radio name="radioButton" list="#{'os':'OS','platform':'Platform''}" value="1" />
<div id="OS_req">
<s:form name="sendreqOS" action="Login" ><br/>
<s:textfield name="vmNameOS" maxlength="30" size="20" label="VM Name" />
<s:select labelposition="left" label="Template" list="temp" name="templateNameOS"/>
<s:select labelposition="left" label="Instance Type" name="instanceTypeOS" list="#{'1':'Small','2':'Medium','3':'Large'}" />
<s:select label="Duration of use" name="durationOS" list="#
{'1':'1 week','2':'2 weeks','3':'1 month','4':'3 months','5':'6 months'}" />
<s:submit value="Submit"></s:submit>
</s:form></div>
<div id="Plat_req">
<s:form name="sendreqPlat" action="Login" ><br/>

<s:textfield name="vmNamePlat" maxlength="30" size="20" label="VM Name" />
<s:select labelposition="left" label="Template" list="temp" name="templateNameplat"/>
<s:select labelposition="left" label="Instance Type" name="instanceTypeplat" list="#{'1':'Small','2':'Medium','3':'Large'}" />
<s:select label="Duration of use" name="duration plat" list="#{'1':'1 week','2':'2 weeks','3':'1 month','4':'3 months','5':'6 months'}" />
<s:submit value="Submit"></s:submit></form></div>

On clicking 'OS' radio button I want to get the 1st form and hide second one and on clicking 'Platform' radio button I want the second form and hide the first one.

View 13 Replies View Related

Change Text Within Paragraph Depending On Radio Button?

Mar 23, 2011

I have an electronics site on which I have a code generator. Im an stuck on how to acheive something.

I will simplify what I want to do, so I can then adapt it to my code. I have a paragraph of text on the web page, on which I want to change some words with in the paragraph depending on 2 radio buttons.

Example (radio buttons & short paragraph):

(Radio Button) Apples (checked) (Radio Button) Bananas "Welcome to jakes fruit shop. You have selected apples today" (apples being the word that would change if the banana radio button is checked)

Here is the code generator if your interested. [URL] What I actually want to do is put other 'fixed' text in the input text area (near botton of page) with only the config line changing.

And If I can be shown how to do the short example above, i think I will be able to edit my generator and get it to do what i want it to do.

View 6 Replies View Related

Background Color Of Table Change With Radio Button

Mar 27, 2006

I'm trying to create a cell in a table which changes color depending which radio button is checked.

I found the following code which works for different cells but it doesn't work when the buttons are in the same cell. Think you'll see what i mean. I'm not too hot when it comes to Javascript though so i don't know how to adapt what I've got so far. Code:

View 3 Replies View Related

Clicked Radio Button Text To Change Colour

Mar 3, 2005

i made a quiz using radio buttons and ofcourse javascript,but to further customized my quiz i want an event handler in which it will change the text color attached to a particular radio button when the user clicks an option.

View 1 Replies View Related

Change A Label At Page Load Based On Radio Button

Mar 2, 2010

I have a webpage which has two radio buttons. There is a label also in the web page. I want the label string to be based on the radio button status. I am able to change when somebody press the radio button using "onclick" function, but now when the page is reloaded.

Here is my code

Code:

I want the highlighted label value to be changed based on the radio button value at the start up itself( ie if the page get reloaded if some error has happend at filling the form)

View 2 Replies View Related

JQuery :: Pass Radio Button Selection To Hidden Div And Then Show Div List From Chosen Radio Button?

Mar 16, 2010

I am a PHP programmer and new to Javascript and jQuery and I have tried about 20 examples/tutorials and cannot seem to get even close to what I want.I have a form (PHP/MySQL) with a list of subjects I got from my database, and then create a set of radio buttons from that list. And based on what radio button they select, I need to pass that variable to a div (at least that's what I want to use) and then show a list of videos that match the radio buttons value. I don't care if its a get or post or other.I tried to use GET or POST so I can use that value for my PHP/MySQL lists.I am open to any suggestions/tutorials, etc.

View 1 Replies View Related

Select Radio Button And Change Style When Table Cell Is Clicked?

Jul 3, 2007

I have this code that changes the color of the table cell when it is moused over, but I would like to also have it do this:

select radio button when cell is clicked.
change class to blue3 when clicked and leave it like that until another is clicked.
Continue changing color on mouseover. Code:

View 4 Replies View Related

Show / Hide Div Layer / Change Link Color / When Radio Button Is Selected

Aug 16, 2010

I am trying to develop an exam system.Find my code below.I request you to copy the code and save it as an html file .I have 2 problems:

1. Kindly notice that when the quiz is loaded,it shows both the questions by default.I want only question 1 to be visible when the quiz loads.What happens presently is that ,both questions are visible even after I click on the link
Q.1( referring to question 1).However,when I click on
Q. 2,then only question 2 can be seen and then(after clicking on Q.2) if I click on Q.1,then only question 1 can be seen

What I want is that when the page loads only question 1 is visible.Then when I click on Q.2,I can see only question 2 and when I click on Q.1, I can see only question 1.I later plan on adding many questions,so it should be a general solution rather than a solution good only for 2 questions.

2.Also,what I want is that,if someone selects any of the answers of a particular question,it's link color should turn green to indicate to the user that he answered that question.So for,instance,if I select an answer to the first question(select one of London,New York,Seattle,Washington,Chicago), the link Q.1 should turn green.

View 3 Replies View Related

Program A Radio Button To Open An "invisible" Input Field?

Aug 24, 2011

I've learned HTML and CSS pretty thoroughly.I think I have most of the Javascript basics down as far as definitions, but I'm getting hung up on the actual coding.I'm working on an information request form for my fiancee's business site. In it, I want to have options that users select via radio buttons. Rather than having additional input fields static on the page, I would like to program some of the radios, when clicked, to open a previously unseen option where users will then be able to type in the necessary information.More specifically, since she only works in two states, I want a third option of "other," which,when opened, will allow the user to input any other state.Then, should the radio be deselected or reset, the field would disappear again.

If my understanding is correct, I think I will need to use a javascript function in the header, an HTML "div" section with ID, "onclick" and "offclick" events in the button mark-up, and the specific javascript code to call the function (getElementById?).

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved