Ready to get started?Download WordPress


javascript within widget form (1 post)

  1. Koff
    Posted 3 years ago #

    I am trying to add a widget.
    The widgets form should be dynamic.
    for example Email filed is shown just if a checkbox is selected.

    From some reason i cant get it to work.

    Here is the code:

    <input id="checkme" type="checkbox" />
    <div id="extra">
    <label for="email">Email Address:</label>
    <input id="email" type="text" />

    and the javascipt:

    <script type="text/javascript"> 
    		//Hide div w/id extra
    		// Add onclick handler to checkbox w/id checkme
    		// If checked
    		if ($("#checkme").is(":checked"))
    			//show the hidden div
    			//otherwise, hide it

Topic Closed

This topic has been closed to new replies.

About this Topic