alert

alert

after pressing ok button in alert message it has to stop but it is going to next page plz help form this problem

View Answers

January 6, 2011 at 12:11 PM

Hi Friend,

Try the following code:

login.html:

<html>
<script>
function validate(){
var username=document.form.user.value;
var password=document.form.pass.value;
if(username==""){
 alert("Enter Username!");
  return false;
}
if(password==""){
 alert("Enter Password!");
  return false;
}
return true;
}
</script>
<form name="form" method="post" action="check.jsp" onsubmit="javascript:return validate();">
<table>
<tr><td>Username:</td><td><input type="text" name="user"></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

Thanks


January 6, 2011 at 12:11 PM

Hi Friend,

Try the following code:

login.html:

<html>
<script>
function validate(){
var username=document.form.user.value;
var password=document.form.pass.value;
if(username==""){
 alert("Enter Username!");
  return false;
}
if(password==""){
 alert("Enter Password!");
  return false;
}
return true;
}
</script>
<form name="form" method="post" action="check.jsp" onsubmit="javascript:return validate();">
<table>
<tr><td>Username:</td><td><input type="text" name="user"></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>

Thanks









Related Tutorials/Questions & Answers:
alert
alert  after pressing ok button in alert message it has to stop...; if(username==""){ alert("Enter Username!"); return false; } if(password==""){ alert("Enter Password!"); return false; } return true; } </script> <
alert in jsp
alert in jsp  if(pass.equals(pwd)) { Statement st1..."); %> alert("password is successfully changed"); <... Password"); %> <script> alert("please enter old Password
Advertisements
alert for validation
alert for validation  i want to put alert on the text box that enter...) if (cpos1==-1 || cpos2==-1){ alert("The date format must be : dd/mm/yyyy... || pmonth<1 || pmonth>12){ alert("Enter a valid month") return
Alert in Servlet
Alert in Servlet  <p>Hi</p> <p>I want to delete record from oracle db, i need alert message saying 'Are you sure you want... of each row, when i click delete it shd alert me....This is my servlet code:<
change appearance of alert box
change appearance of alert box  how to change the appearance of an alert() box
GETTING ALERT MESSAGE
GETTING ALERT MESSAGE  how to get an alert message when radio button is selected instead of checkbox
Javascript alert message
Javascript alert message   How to send an alert message to a user in JavaScript
javascript prompt alert
javascript prompt alert   Sending a prompt alert using a JavaScript function
ModuleNotFoundError: No module named 'alert'
ModuleNotFoundError: No module named 'alert'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'alert' How to remove the ModuleNotFoundError: No module named 'alert'
GETTING AN ALERT MESSAGE
GETTING AN ALERT MESSAGE  how to get an alert message, if i select radio button instead of checkbox(associated with 3 dropdown list
JavaScript Alert YES NO
JavaScript Alert YES NO  How to send an alert to a user to confirm if there request is valid or not? I wants to send the alert message in Java Script... type="text/javascript"> function show_alert(my_string) { alert(my_string
javascript statement alert
javascript statement alert  JavaScript Alert If Statement   JavaScript Alert if Statement <script type="text/javascript"> <...;/script> JavaScript Alert else if Statement <script type="text/javascript
alert box in iphone
alert box in iphone  hello, how can i show alert box in my iphone application??   hello,ADS_TO_REPLACE_1 you can use this code for show the alert .. UIAlertView *alt = [[UIAlertView alloc] initWithTitle: @"Title
JavaScript display variable in alert
in alert box? I am using javascript.   <html> <head> <script..."; var city = "Delhi"; alert(name +" is in "+ city); } </script> </head> <body> <input type="button" value="Click for Alert" onClick
jQuery alert()
jQuery alert() In this jQuery tutorial we will discuss how an alert box works in jQuery. Moreover, this tutorial will discuss in details about alert box in jQuery. In the given application here, alert boxes have been used to provide
Information Save Alert
Information Save Alert  Hi, Sir I am creating a web page there user can edit their information. I want a javascript that can show an alert message when user edit the information and trying to close or go to another page without
JSP Alert
JSP Alert          JSP Alert is used to put the validation on login... to create alert box in a JSP page. Before applying validation we create a JSP file
ModuleNotFoundError: No module named 'aws-alert'
ModuleNotFoundError: No module named 'aws-alert'  Hi, My Python... 'aws-alert' How to remove the ModuleNotFoundError: No module named 'aws-alert' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'django-alert'
ModuleNotFoundError: No module named 'django-alert'  Hi, My Python... 'django-alert' How to remove the ModuleNotFoundError: No module named 'django-alert' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-alert'
ModuleNotFoundError: No module named 'django-alert'  Hi, My Python... 'django-alert' How to remove the ModuleNotFoundError: No module named 'django-alert' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-alert'
ModuleNotFoundError: No module named 'django-alert'  Hi, My Python... 'django-alert' How to remove the ModuleNotFoundError: No module named 'django-alert' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-alert'
ModuleNotFoundError: No module named 'django-alert'  Hi, My Python... 'django-alert' How to remove the ModuleNotFoundError: No module named 'django-alert' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'kotti-alert'
ModuleNotFoundError: No module named 'kotti-alert'  Hi, My Python... 'kotti-alert' How to remove the ModuleNotFoundError: No module named 'kotti-alert' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'mail-alert'
ModuleNotFoundError: No module named 'mail-alert'  Hi, My Python... 'mail-alert' How to remove the ModuleNotFoundError: No module named 'mail-alert' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'nose-alert'
ModuleNotFoundError: No module named 'nose-alert'  Hi, My Python... 'nose-alert' How to remove the ModuleNotFoundError: No module named 'nose-alert' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'omsa-alert'
ModuleNotFoundError: No module named 'omsa-alert'  Hi, My Python... 'omsa-alert' How to remove the ModuleNotFoundError: No module named 'omsa-alert' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'rabbitmq-alert'
ModuleNotFoundError: No module named 'rabbitmq-alert'  Hi, My... named 'rabbitmq-alert' How to remove the ModuleNotFoundError: No module named 'rabbitmq-alert' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'slack-alert'
ModuleNotFoundError: No module named 'slack-alert'  Hi, My Python... 'slack-alert' How to remove the ModuleNotFoundError: No module named 'slack-alert' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'supervisor-alert'
ModuleNotFoundError: No module named 'supervisor-alert'  Hi, My... named 'supervisor-alert' How to remove the ModuleNotFoundError: No module named 'supervisor-alert' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'timed-alert'
ModuleNotFoundError: No module named 'timed-alert'  Hi, My Python... 'timed-alert' How to remove the ModuleNotFoundError: No module named 'timed-alert' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'alert-grid'
ModuleNotFoundError: No module named 'alert-grid'  Hi, My Python... 'alert-grid' How to remove the ModuleNotFoundError: No module named 'alert-grid' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'aws-alert'
ModuleNotFoundError: No module named 'aws-alert'  Hi, My Python... 'aws-alert' How to remove the ModuleNotFoundError: No module named 'aws-alert' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'django-alert'
ModuleNotFoundError: No module named 'django-alert'  Hi, My Python... 'django-alert' How to remove the ModuleNotFoundError: No module named 'django-alert' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'easy-alert'
ModuleNotFoundError: No module named 'easy-alert'  Hi, My Python... 'easy-alert' How to remove the ModuleNotFoundError: No module named 'easy-alert' error? Thanks   Hi, In your python environment you
Version of com.michaelpardo>materialdesignicons-alert dependency
List of Version of com.michaelpardo>materialdesignicons-alert dependency
java hello and timer alert application
java hello and timer alert application  Hi, Please help me create a simple Java application that can display "Hello world" and current Time alert on mobile device screen using mobile screen emulator. Regards
jQuery Hello World alert
jQuery Hello World alert example    ... display "Hello World" alert box using jQuery. This application will use the JavaScript alert() method to display the "Hello World" message
jQuery alert()
jQuery alert() In this section we will discuss about alert box in jQuery. In an application alert boxes are used to provide information at run time... information at runtime. Alert box can be popped up after happening an event
Getting content of alert message into textfield
Getting content of alert message into textfield  how to get content of alert message into textfield using javascript   Getting content of alert message into text field 1)If you want the code in java, then here
Getting content of alert message into textfield
Getting content of alert message into textfield  how to get content of alert message into textfield using javascript   Getting content of alert message into text field 1)If you want the code in java, then here
why alert box is not appearing in servlets...?
why alert box is not appearing in servlets...?  //example.java import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class adduser extends HttpServlet { public void init(ServletConfig config
Alert Control in Flex4
Alert control in Flex4: The Alert control is a MX component. It has no Spark component. The Alert control contains a message, icon, title, and buttons. Flex uses the show() method of the Alert classfor open a dialog box. The Syntax
ModuleNotFoundError: No module named 'aws-sqs-alert'
ModuleNotFoundError: No module named 'aws-sqs-alert'  Hi, My... 'aws-sqs-alert' How to remove the ModuleNotFoundError: No module named 'aws-sqs-alert' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'iota_balance_change_alert'
ModuleNotFoundError: No module named 'iota_balance_change_alert'  Hi...: No module named 'iota_balance_change_alert' How to remove the ModuleNotFoundError: No module named 'iota_balance_change_alert' error? Thanks  
ModuleNotFoundError: No module named 'simple-monitor-alert'
ModuleNotFoundError: No module named 'simple-monitor-alert'  Hi...: No module named 'simple-monitor-alert' How to remove the ModuleNotFoundError: No module named 'simple-monitor-alert' error? Thanks   Hi
ModuleNotFoundError: No module named 'stormbot-yocto-alert'
ModuleNotFoundError: No module named 'stormbot-yocto-alert'  Hi...: No module named 'stormbot-yocto-alert' How to remove the ModuleNotFoundError: No module named 'stormbot-yocto-alert' error? Thanks   Hi
ModuleNotFoundError: No module named 'zabbix-weixin-alert'
ModuleNotFoundError: No module named 'zabbix-weixin-alert'  Hi, My... named 'zabbix-weixin-alert' How to remove the ModuleNotFoundError: No module named 'zabbix-weixin-alert' error? Thanks   Hi
ModuleNotFoundError: No module named 'alert-from-script'
ModuleNotFoundError: No module named 'alert-from-script'  Hi, My... named 'alert-from-script' How to remove the ModuleNotFoundError: No module named 'alert-from-script' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'aws-sqs-alert'
ModuleNotFoundError: No module named 'aws-sqs-alert'  Hi, My... 'aws-sqs-alert' How to remove the ModuleNotFoundError: No module named 'aws-sqs-alert' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cabot-alert-alerta'
ModuleNotFoundError: No module named 'cabot-alert-alerta'  Hi, My... named 'cabot-alert-alerta' How to remove the ModuleNotFoundError: No module named 'cabot-alert-alerta' error? Thanks   Hi, In your

Ads