/    Sign up×
Community /Pin to ProfileBookmark

Great day!

Kindly help me sir/madam..

Picture:[url]http://i.imgur.com/yQAErOk.jpg[/url]
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’
);
}
});

to post a comment
Full-stack Developer

0Be the first to comment 😎

×

Success!

Help @glenotz2407 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...