how can we show all in a select box change

how can we show all in a select box change

ASLASL Posts: 13Questions: 7Answers: 0

Hi i have the below code for a select box function

$('.search-input-select1').on( 'change', function () { // for select box
var v =$(this).val();
console.log(v);
$.ajax({
type:"post",
url:"user.php",
data:"createdBy="+v,
success:function(data){
var usr = data;

but when the value of v is null/ ' ', i want another particular set of code to be run. How can i do that if condition and where has it to be done - in here or in user.php ?

This discussion has been closed.