To enter the ID number in a textbox it displays me the location on the scale in the other textbox. As in this jsFiddle: /
If the type a User ID number that does not exist in table it returns me the warning "No ID Number". Is it possible to do this?
$( "button" ).click(function() {
var inputValue = $('#inputCell').val(); //User Digit
//Convert Object
var table = $('#tableHtml');
//Verify blank value
if( inputValue == ""){
alert('Digit Number Id!');
}
else{
//Check exist value !!!!!
if($(table).find("tr").eq(inputValue).text() == ""){
//find cell
var valuefinal = $(table).find("tr").eq(inputValue).find("td").eq(1).text();
$('#valueCell').val(valuefinal);
}
else{
alert('No ID Number!');
}
}
});
var inputValue = $('#inputCell').val(); //User Digit
//Convert Object
var table = $('#tableHtml');
//find cell
var valuefinal = $(table).find("tr").eq(inputValue).find("td").eq(1).text();
$('#valueCell').val(valuefinal);
//Check exist value
if (valuefinal == "") {
alert("Not found");
cleanInput();
}
To enter the ID number in a textbox it displays me the location on the scale in the other textbox. As in this jsFiddle: http://jsfiddle/JoaoFelipePego/SdBBy/310/
If the type a User ID number that does not exist in table it returns me the warning "No ID Number". Is it possible to do this?
$( "button" ).click(function() {
var inputValue = $('#inputCell').val(); //User Digit
//Convert Object
var table = $('#tableHtml');
//Verify blank value
if( inputValue == ""){
alert('Digit Number Id!');
}
else{
//Check exist value !!!!!
if($(table).find("tr").eq(inputValue).text() == ""){
//find cell
var valuefinal = $(table).find("tr").eq(inputValue).find("td").eq(1).text();
$('#valueCell').val(valuefinal);
}
else{
alert('No ID Number!');
}
}
});
var inputValue = $('#inputCell').val(); //User Digit
//Convert Object
var table = $('#tableHtml');
//find cell
var valuefinal = $(table).find("tr").eq(inputValue).find("td").eq(1).text();
$('#valueCell').val(valuefinal);
//Check exist value
if (valuefinal == "") {
alert("Not found");
cleanInput();
}
WORKING DEMO
$( "button" ).click(function() {
var inputValue = $('#inputCell').val(); //User Digit
//Convert Object
var table = $('#tableHtml');
if( inputValue > table.find('tr').length - 1 ) {
alert('No ID Number');
} else
//Verify blank value
if( inputValue == ""){
alert('Digit Number Id!');
}
else{
//find cell
var valuefinal = $(table).find("tr").eq(inputValue).find("td").eq(1).text();
$('#valueCell').val(valuefinal);
}
});