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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:48:32+00:00 2026-05-25T06:48:32+00:00

I have the following form: <form action= method=get> <input name=form1 type=radio onclick=document.forms[0].testbox.value=’0.00′; /> <input

  • 0

I have the following form:

<form action="" method="get">
<input name="form1" type="radio" onclick="document.forms[0].testbox.value='0.00'; "/>
<input name="form1" type="radio" onclick="document.forms[0].testbox.value='1.00'; "/>
<input name="" type="checkbox" value="" onclick="document.forms[0].testbox2.value='1.00'; "/>
<input name="testbox" type="text" value="0.00"/>
<input name="testbox2" type="text" value="0.00"/>
</form>

When radio button changed, the value in the text box also changes from 0.00 to 1.00 back to 1.00 etc..

I want to do the same thing with the tick/checkbox – when clicked value in testbox2 should become 1.00, when unclicked should go back to 0.00..

The same onclick coding not working? Ideas?

Thank you

Following comments tried this.. But not working??

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">

 <head>
 <script type="text/javascript">
 function checkboxClick() {
 var textbox = document.forms[0].testbox2;
 textbox.value = (textbox.value == 0) ? '1.00' : '0.00';
 }
 </script> 

 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>Untitled Document</title>
 </head>
 <form action="" method="get">
 <input name="form1" type="radio" onclick="document.forms[0].testbox.value='0.00'; "/>
 <input name="form1" type="radio" onclick="document.forms[0].testbox.value='1.00'; "/>
 <input name="" type="checkbox" value="" onclick="document.forms[0].testbox2.value='1.00'; "/>
 <input name="testbox" type="text" />
 <input name="testbox2" type="text" value="0.00"/>
 </form>
 <body>
 </body>
 </html>

Forgot to add this change changes to onclick as suggested below.. Thank you.. Perfect..

  • 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-25T06:48:33+00:00Added an answer on May 25, 2026 at 6:48 am

    You need to toggle the value between 0 and 1. The you’re onclick just sets the textbox to 1.00.

    <script>
    function checkboxClick() {
        var textbox = document.forms[0].testbox2;
        textbox.value = (textbox.value == 0) ? '1.00' : '0.00';
    }
    </script>
    
    <form method='get' action='#'>
        <input name='testbox2' value='0.00'>
        <input type='checkbox' onclick='checkboxClick()'>
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have the following form <form action=ManageLink method=post> <input name=artistName type=text/> <input name=songName type=text/>
I have a form with the following format: <form id=program name=program method=get action=process.jsp> <div
I have the following email form: <form action=mailer.php method=post name=form1 id=form1 onsubmit=MM_validateForm('from','','RisEmail','name','','R','verif_box','','R','message','','R');return document.MM_returnValue> <table
I have the following form <form name=myForm id=myForm method=post enctype=multipart/form-data action=script.php> and this jQuery
I have the following form on an .NET MVC View: <form method=post enctype=multipart/form-data action=/Video/UploadDocument>
If I have the following struts.xml config: <action name=input> <result>/jsp/input.jsp</result> </action> <action name=result> <result>/jsp/result.jsp</result>
I have de following Form: <form action=/AppStore/publish method=post accept-charset=ISO-8859-1> <fieldset> <legend>Do you have an
I have done the following form <% form_for @anexo, :url => {:action => create},
I have the following form for photo_album which uses the nested forms feature of
I have the following form code: # forms.py class SomeForm(forms.Form): hello = forms.CharField(max_length=40) world

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.