Great day!
Kindly help me sir/madam..
Picture:[url]http://i.imgur.com/yQAErOk.jpg
let say that: i have a 2 textbox as you see the image..
ORDER NUMBER 1. <input name=”order_numbr”type=”text” class=”textbox” id=”order_numbr” value=””>
ORDER NAME 2. <input name=”ur_name1″ type=”text” class=”textbox” id=”ur_name1″ value=””>
Ive already finished the 2 case but the 3rd case not yet done kindly help me please
case 1: If the order number is empty says “this field is required”.
case 2: If you enter invalid order number says “This order number does not exists”.
case 3: When If you enter valid order number automatically display order name in the textbox ORDER NAME without clicking a button..
Ive almost done but the order name doesnt display in the textbox ORDER NAME
Database:
order_no order_name
23532 House of Glass BC
32532 Inner Weather
53254 Fernwood Fitness
53253 Aspect Joinery
more.. more..
I want that the output of the order name is in default value. It is impossible to do this?
here is my code:
jQuery.validator.addMethod(“ordrNum”,function(value,element){
var isExist=false;
$.ajax({
type : “POST”,
async: false,
data : “action=checkOrdrNum&id=0&orderno=” + value,
url : ajaxurl,
dataType:”json”,
success: function (data) {
//console.log(data[“order_no”]);
if (data[“order_no”] >0) {
isExist=true;
}
}
});
//console.log(isExist);
return isExist;//true;
},”This order number does not exist”);
$(document).on(‘keyup’, ‘#order_numbr’, function() {
if( $(‘form’).valid() ) {
$.post( ajaxurl, {“action”:”checkOrdrNum”,”id”:0,”orderno”: $(this).val()},
function( data ) {
$(‘#ur_name1’).val( data );
},
‘text’
);
}
});