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

Ads
 

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

Ads









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
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
Advertisements
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
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 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
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
radio button
radio button  On selecting a radio button, it should open a aspx page
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
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... according to student data then click submit button that will call another jsp 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
Jquery Hide and Show Div
in HTML can be shown or hide on button click method in jQuery. The jQuery show...="mycontentdiv">Click Hide button, to disappear.</div> <...Using jQuery effects one can perform lots of task such as Hide, Show, Toggle
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
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
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
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
How to identify the radio button id and row id in a table in jsp?
How to identify the radio button id and row id in a table in jsp?   function generateid(no) {var table = document.getElementById(tableID); var rowCount = table.rows.length
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
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
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
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
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
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
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
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
passing value of radio button
passing value of radio button  hi,i have 3 jframe built using the GUi editor in net beans 6.9. i have two radio button in the first jframe.i have... frame.plz help me how can i do so? PLEASE note that all the codes
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

Ads