WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Contact Form 7] Radio button + expand field (1 post)

  1. M Szatkowski
    Member
    Posted 3 years ago #

    Hi,
    I'm tring to prepare a solution similar to following, regardless of the core code of plugin.

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Radio Button Event Page</title>
    <script language="javascript">
    <!--//
    function change_display(field) {
    	if (field != "2"){
    		document.getElementById("div1").style.display ='block';
    		document.getElementById("div2").style.display = 'none';
    	}
    	else {
    		document.getElementById("div1").style.display ='none';
    		document.getElementById("div2").style.display = 'block';
    	}
    }
    //-->
    </script>
    </head>
    <body>
    <input type="radio" name="rdo" id="rdo" value="1" onclick="change_display(this.value);" /> - option 1<br />
    <input type="radio" name="rdo" id="rdo" value="2" onclick="change_display(this.value);" /> - option 1<br />
    <p>
    	<div id="div1" style="display:none">DIV 1</div>
    </p>
    <p>
    	<div id="div2" style="display:none">DIV 2</div>
    </p>
    </body>
    </html>

    Any idea/solution?

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic