How to clear inputs within div based on toggle of radio button using jQuery?

You can try something like this: $('. Toggle'). On('change',function(){ var showOrsiblings('inputtype=radio').andSelf().

Each(function() { if ($(this).val() == 1 && $(this). Prop("checked")) showOrparent(). Next('#details').

Toggle(showOr if (showOrparent(). Next('#details'). Find('inputtype=text').

Val(''); $(this).parent(). Next('#details'). Find('input:checkbox').

RemoveAttr('checked'); // other fields type to clear } }).change() here is un updated fiddle : http://jsfiddle.net/XVtB8/2.

You could try - $('. Toggle'). On('change',function(){ var showOr var ClearDivs = false; $(this).

Siblings('inputtype=radio').andSelf(). Each(function() { if ($(this).val() == 1 && $(this). Prop("checked")) showOrval() == 0 && $(this).

Prop("checked")) ClearDivs = true; }) $(this).parent(). Next('#details'). Toggle(showOr if (ClearDivs) $(this).parent().

Next('#details'). Find('inputtype=text'). Val(''); }).change() Demo - http://jsfiddle.net/58xqM/7.

I think you should improve the markup of your form, so that it would make sense, then go about in jQuery. See this Example Points Use s to group form elements, and to give it a title. Labels are to be used with form elements, as shown in the example.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions