How to hide and show some field on a radio button click

How to hide and show some field on a radio button click

This is my code part:-

PAYMENT DETAILS
 <table cellpadding="0" cellspacing="0" align="center" border="5" bordercolor="#003333" align="center" width="70%">
     <tr>
       <td width="25%">
          <b class="label">Payment Type<b>
       </td>
       <td width="40%">
        <INPUT TYPE=radio NAME="payment_method" VALUE="cash" CHECKED><b class="label">By Cash</b></input>
         <INPUT TYPE=radio NAME="payment_method" VALUE="cheque" onclick="return payment();"><b class="label">By Cheque</b></input>
       </td>  
       <td>
          <b class="label">Payment Date<b>
       </td>
       <td>
      <jsp:include page="calendar_1.html" />


       </td>       
     </tr>
     <tr rowspan="4">
       <td>
          <b class="label">Cheque Number<b>
       </td>
       <td>
            <input type="text" value="" name="chqno">
       </td> 
        <td>
          <b class="label">Bank Name<b>
       </td>
       <td>
            <input type="text" value="" name="bankname">
       </td>  
     </tr>
     <tr colspan="2">

       <td>
          <b class="label">Amount<b>
       </td>
       <td>
            <input type="text" value="" name="amount1">
       </td>       
     </tr>
 </table>

I want bank name and cheque number label and textbox to be invisible when by cash radio button is clicked.and they should be visible when by cheque radio button is clicked.

I have applied javascript for this as:-

function payment(e) { if (e.value==cash) { document.getElementById(chqno).style.display=block; document.getElementById(bankname).style.display=block; } else { document.getElementById(chqno).style.display=none; document.getElementById(bankname).style.display=none; }

}

please help me with this

View Answers









Related Tutorials/Questions & Answers:
How to hide and show some field on a radio button click
How to hide and show some field on a radio button click  This is my... and cheque number label and textbox to be invisible when by cash radio button is clicked.and they should be visible when by cheque radio button is clicked. I have
Hide/Show paragraph by button click
Hide/Show paragraph by button click In this tutorial, we will discuss about how to hide/show paragraph by clicking on button using jQuery. In the below... displays another button "click to show paragraph " .when we click
Advertisements
Toggle hide/show by clicking same button
Toggle hide/show by clicking same button In this tutorial, we will discuss about how to toggle hide/show by clicking button. In the given below 2 example, there is button ,by clicking on it, the paragraph will hide/show . In first
How to add radio button value in a table for particular field?
How to add radio button value in a table for particular field?  Hi,I... one radio button for text field then it insert only one value absent OR present... dynamically from other table and two radio button one for present and the second
Show text by button click using jQuery
Show text by button click using jQuery In this tutorial, we will discuss about hide/show text by clicking on button. In the below example, there are two buttons : hide and show .The "hide " button is used to hide text
get a radio button click value - JSP-Servlet
get a radio button click value  thanks sir for sending code ,but i...") in servlet that is used in another jsp so can i call getParameter("radio") i.e in the input tag name="radio" eventhough i m getting a null value please help me
Hide/show Image by click
Hide/show Image by click In this tutorial ,we will discuss about how to display image by click using jQuery. In the below example, a image and two lines...; Click here to hide the logo </font> </div> <div id
Hide text by clicking button
Hide text by clicking button In this tutorial, we will discuss about hide/show... : hide and show .The "hide " button is used to hide text and "show button " is used to show text. These actions are fired when "
Dojo Radio Button
button do some action on press.  Try Online: Radio ButtonADS_TO_REPLACE_1... must select exactly only one choice from a group of radio button. Click a non...Dojo Radio Button         
how to show search results in the same panel of jframe to where search field and button is present..
how to show search results in the same panel of jframe to where search field and button is present..  Hello Sir, Sir i do have one more query... search field and button is present . please Sir, send me the code
How to show next question from database on the click of next button..(Struts & Hibernate)
How to show next question from database on the click of next button..(Struts... 2 tables. Cards and CardTopics. cardtopic(field) is common to both the tables. Problem.: When m clicking my next button it is not showing another question
How to show next question from database on the click of next button..(Struts & Hibernate)
How to show next question from database on the click of next button..(Struts... 2 tables. Cards and CardTopics. cardtopic(field) is common to both the tables. Problem.: When m clicking my next button it is not showing another question
hide show keyboard iphone
hide show keyboard iphone  How to hide show keyboard in iPhone programmatically
hide show keyboard iphone
hide show keyboard iphone  How to hide show keyboard in iPhone programmatically
hide show keyboard iphone
hide show keyboard iphone  How to hide show keyboard in iPhone programmatically
Show text field & check input using jQuery
Show text field & check input using jQuery In this tutorial, we will discuss about how to display 'text field' by a button click & check... how to display 'text field' by a button click & check input using
Radio button in JSP - JSP-Servlet
Radio button in JSP  Hi! In my page I have two radio buttons. If i select first radio button. one text field has to be displayed.... If i select second radio button. text field has to be disappeared. pls.... help me.. 
How to Hide Button using Java Swing
How to Hide Button using Java Swing  Hi, I just begin to learn java programming. How to hide the button in Java programming. Please anyone suggest... Programming application how to hide the buttons using Java Swing. Please Visit
how can i hide and show tables
how can i hide and show tables  hai, i am creating a form which the code is included below i want to hide the tables initially and after i click go... the style attribute, we have made table invisible. But, when the user click Go button
how to show search results in the same panel of jframe to where search field and button is present..
how to show search results in the same panel of jframe to where search field and button is present..  Hello Sir, I am working on project where i have to show the search result in the same panel of where search field
How to call java method on Button click in jsp?
How to call java method on Button click in jsp?  How to call java method on Button click in jsp
Jquery Hide and Show Div
that illustrates how to can hide and show HTML elements with the hide() and show...;body> <div id="mycontentdiv">Click Hide button, to disappear.<... the DIV elements in HTML can be shown or hide on button click method in jQuery
radio button
radio button  On selecting a radio button, it should open a aspx page
JavaScript Hide Button
; In this section, you will learn how to hide the button using JavaScript... JavaScript Hide Button... the page you will get the button. On clicking the button, the function hide
JSP hide and show tables
JSP hide and show tables In this tutorial, you will learn how to hide and show... which is having a table consists of database data and a Go button. Using the style attribute, we have made table invisible. But, when the user click Go button
Show Hide Text Javascript - Java Beginners
Show Hide Text Javascript  Please tell me how to show hide text using Java Script
JavaScript Show Hide table
; In this section, we are going to show and hide table on clicking the button using... JavaScript Show Hide table.... On clicking the button 'Show', the function showTable() is called and the table
hide and show result in jsp
hide and show result in jsp  what codes do i have to change to make my result display if only i enter the correct value? suppose if i click search,then the result will be display at the bottom.. if not.. only the header
How to use radio button in jsp page
How to use radio button in jsp page       This is detailed java code how to use radio... stream, branch, course type according to student data then click submit button
radio button - Development process
but when i click on cr radio button and enter value in text box.it enter the msg but it again go to sr radio button   Hi friend, Plz give full...radio button  hi, there is 2 radio button and five text box
on click button php
on click button php  Function in PHP for on click button
iPhone Radio Button Example
iPhone Radio Button Example  Can you please suggest me how to create Radio button in my iPhone application. Actually, in my application i have two... click on that button it get selected and by default it should display unselected
react show another component on click
react show another component on click  Hi, I want to show the another component view on the click on the button or link? What is code for react show... application development library. You can click on a button and then in the JavaScript
Struts 2 Radio Button
radio buttons and I am using Struts2 tag.I want first rado button to be selected by default.But when i select the second radio button and hit on search button i want to retain the selection of that second radio button on search list
Query on radio button
Query on radio button  I am having a multiple row in jsp page.They are dynamically coming. For each row there is one radio button. I want to select..., the values should got to a ActionClass. My query is that how do i send all
how to display default radio button in struts2.0 for first time login - Struts
how to display default radio button in struts2.0 for first time login  hi, this is suresh jampala, i have one question regarding struts2.0,how can i display default radio button in struts2.0 when ever i loggedin first time
iphone button click event
iphone button click event  Hi, How to write iphone button click event? Thanks   Hi, Here the method declaration: -(IBAction) myMetod...{ NSLog(@"Button clicked"); } Thanks
pass radio button values to next page
pass radio button values to next page  how to pass selected radio button values which coming from mysql database to next page using php. Please show me with examples
insertin form data into databse and blank all form field when click on submit button
database when click on submit button and blank all form field after inserting...insertin form data into databse and blank all form field when click on submit...) Click "Ok" and then try the JSP. form.jsp: <form name="form" method="post
radio button - Development process
radio button  hello,i want to creat two radio button.out of which only one can be selected.and can show the contain of selected radio box   Hi friend, Code to solve the problem : My Page Radio 11
validation of radio button
validation of radio button  There are 3 radio button as A,B,W. there are another radio as 1,2,3.if we select W in first radio button then should select 2nd one(1,2,3).if we select A or B not need select any one from 1,2,3
passing values on button click
passing values on button click  Please help me to solve this issue.I want to pass a value assigned to button to another view upon button click in xcode
show, hide, disable components on a page with struts - Struts
show, hide, disable components on a page with struts  disabling a textbox in struts.. in HTML its like disable="true/false" how can we do it in struts
Hide show HTML forms using javascript
Hide show HTML forms using javascript  How to hide a HTML form in my application using JavaScript?   HTML Code to create checkbox <...;div id="yourDiv"> ...other forms... </div> JavaScript function to hide
Show Confirmation Dialog on Click the Command Link
Show Confirmation Dialog on Click the Command Link  How to show Confirmation Dialog when user Click the Command Link
Radio button Validation
Radio button Validation  Hi.. How to validate radio button in java?if the radio button is not selected an error message should be given... Please...()==false)){ JOptionPane.showMessageDialog(null,"Please select radio button
jquery button click
jquery button click  jquery button click - I have created a button in JQuery but the problem is that it's not detecting click. What could... to create a button event in JQuery. You can edit it as per your requirement. In Header
How to check for Empty textboxed and fill it with a value on a button click
How to check for Empty textboxed and fill it with a value on a button... with a Button beside it . when i enter a text in that box and click the button it should go.... the button should be disabled once i click it(i managed to do that), but when i'm
dependent radio button
of the Radio Button is to select only one option at a time. So you don't need...dependent radio button  Hi. I have 4 radio buttons say all,chocolate... the all option and the already selected options should be deselected. How to do
how to pass input from radio button to jsp page
how to pass input from radio button to jsp page  hi.. the code below here there are list of radio buttons here in jsp page when the values..."><label> <input name="radiobutton" type="radio" value

Ads