Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
94
rated 0 times [  99] [ 5]  / answers: 1 / hits: 20955  / 11 Years ago, mon, september 23, 2013, 12:00:00

I am new to Javascript. So I had a doubt for the following function, how to display the error message next to text box? right now it is showing a alert message, but I need to change the alert message and need to display it next to textbox?



function AllowLock(){
if (!locker.lock.value.match(/[a-zA-Z]$/) && locker.lock.value !=) {
locker.lock.value=;
alert(Please Enter only valid lock);
}
if(locker.lock.value.length > 5)
alert(max length exceeded);
}
}

More From » javascript

 Answers
13

you must have any container for that message, so you can create element and then append your message to that,
something like this, with jquery



 <input type=text id=kuku></input>

$('#kuku').after('<div></div>').html(your message);

[#75510] Saturday, September 21, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
zaynerogerb

Total Points: 454
Total Questions: 109
Total Answers: 97

Location: Comoros
Member since Tue, Mar 14, 2023
1 Year ago
zaynerogerb questions
;