• Resolved itsabhist

    (@itsabhist)


    Hi
    thanks for great plugin
    i want to display 2nd search field based on 1st field value

    for examole
    frist field profession is multilelect field
    { teacher , engineer , …)

    and display 2nd field is multiselect field class
    {CLASS1, CLASS2….}

    i want to display 2nd field class if frist field profession selected teacher ..

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Andrea Tarantini

    (@dontdream)

    Hi itsabhist,

    You, or your developer, could add some JavaScript or jQuery code that hides or shows your second field based on the choice made in your first field.

    I’m not a JavaScript expert, but a search for something like:

    “show/hide form fields based on selected option”

    could provide many examples.

    Thread Starter itsabhist

    (@itsabhist)

    Thank You

    jQuery( document ).ready( function ( $ ) {
    				
    	$("#field_4_match_single").change(function() {
    
    			if ($(this).val() == "Teacher") {
    				$('#field_10_like_wrap').show();
    			} else {
    				$('#field_10_like_wrap').hide();
    			}
    		});
    		$("#field_4_match_single").trigger("change");
    	});
    	

    task accomplished ??

    Plugin Author Andrea Tarantini

    (@dontdream)

    That’s great, thank you for sharing your solution!

    Thread Starter itsabhist

    (@itsabhist)

    hi

    after Enabling Select2
    above code is not working

    please help

    Plugin Author Andrea Tarantini

    (@dontdream)

    Hi itsabhist,

    Sorry for the late reply!

    I guess your code above and the Select2 code both act on your field and are apparently not compatible.

    Unfortunately, I’m afraid that how to resolve the incompatibility is beyond my current knowledge.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘conditionally display search field based on condition’ is closed to new replies.