Check box checked automatically, if the imagefiled or textfield filled out

Accepted Solutions (0)

Answers (6)

Answers (6)

khaldoona993089

27-12-2018

<input type="checkbox" id="box" name="box" value="" checked>

<input type="text" id="comment" name="comment" value="" /> 

where mus I put the name of (chekbox ) and TextField ??

Arun_Patidar

MVP

26-12-2018

You can try below for textfield and same can be implemented for image

Edit fiddle - JSFiddle

<input type="checkbox" id="box" name="box" value="">

<input type="text" id="comment" name="comment" value="" />

$(document).ready(function() {

    $("#comment").on("keyup blur", function() {

        $("#box").prop("checked", this.value !== "");

    });

});

khaldoona993089

26-12-2018

when you fill out (imagefield1 ) with any photo , then (chekbox1) return to ((cheked))

and when you fill out (textfield1) with any text, then (checkbox 1 ) return to (checked)) and such ....

the checkboxes are on the top of the form (( like a result )))

the event on (exit*)

I need the whole code for on one (Q) then I gona copy busy rename the rest fields ..

Untitled.jpg

Arun_Patidar

MVP

26-12-2018

where you need to do this, In dialog or in a page?

Anyways It can be done by using jQuery event listenser. where you can attach blur event on textfield and based on input checkbox can be checked/unchecked using jquery/javascript.