0
I have a form, which when submitted, sends data to a modal window. A part of the jquery I have, takes the value sent by the textbox with id "diagnose" and passes this value to the modal window, in a span tag with id "modal_diagnostico", as shown in the line below:
$("#modal_diagnostico"). text($("#diagnostico").val());
I need to pass a fixed text if the value of the texbox "diagnose" is empty (something like "Not informed"), and unfortunately I don’t know how to do that. Can you help me?
tried if(text($("#diagnostico"). val(). length !== 0){ $("#modal_diagnostico"). text($("#diagnostico"). val()); } Else { $("#modal_diagnostico"). text("TEST". val(); } but to no avail
– Leibovich