Without a postback means you will need to use AJAX. You say "is there any way to accomplish this is asp". Do you mean in ASP (active server pages) or are you using .net and you meant asap?
hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 168
In that case you defineitely want to use AJAX. Which is pretty easy in ASP.Net.
Go here http://www.asp.net/ajax and download the AJAX tool kit. Add it as a reference to your projectand you will see extra options appear in the IDE tool kit.
Basically you add an AJAX manager to the page and define which part of the page is going to use AJAX by placing a template control around the correct controls. The webiste above has tutorials that will step you through it.
hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 168
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script>
function checkForInvalid(obj) {
if( /[^0-9\-]|-{2,}/gi.test(obj.value) ) {
alert("Invalid character in Invoice No.")
obj.value = ""; // line added to clear textbox value
obj.focus();
// obj.select(); // line removed
return false;
}
return true;
}
</script>
</head>
<body>
<form name="myForm">
<input type="text" name="invoiceNo" onkeyup="checkForInvalid(this)">
</form>
</body>
</html>
Try this will help you
mani-hellboy
Junior Poster in Training
69 posts since Feb 2012
Reputation Points: 0
Solved Threads: 7
Hey,
For the logging off/back button issue, are you using session state to record the user's logged in status? if yes, when they logout clear the session. Then if they go back your page should check (if you have coded it to do so) if the user is still logged in or not with the session and deny them.
Question 2, client side gets fired first but you may want to use validation controls to check for valid input. These fire before the page is posted back and if the textbox is empty, input is incorrect, etc postback stops and a message can be presented to the user.
hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 168