I have a textbox on my form that a user enters a part number. When the user tabs off the textbox I would like a message box to popup if the item does not exist in the database.
checkPartDatabase.jsp is whatever you have to do to run a check. If you want to pop-up a message at the end of it, then something like this could go there:
Code:
... <JSP code>
<html>
<head>
<script>
alert("Part number <%=partNumber%> is a <%=description%>");
this.location = partForm.html; //readies it for the next go
</script>
</head>
</html>
And if your parent page's textfield's onblur event calls a function (say 'checkPart()'), you will need this in the JavaScript of the parent page:
Code:
function checkPart()
{
checkPartFrame.checkPartForm.partNumber.value = document.formName.textFieldName.value;
checkPartFrame.checkPartForm.submit();
}
if you use the JavaScript in the checkPart() function I provided above, you will have to use 'checkPartFrame' as the ID of the IFRAME (as opposed to just 'checkPart' which is what I used in the sample provided).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.