Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


Venkata Naga Jyothi Vure
alert
2 Answer(s)      3 years and 4 months ago
Posted in : JavaScript Questions


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


Advertisement
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
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, you can use this code for show the alert .. UIAlertView *alt = [[UIAlertView alloc] initWithTitle: @"Title" message: @"Any
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
JSP Alert
JSP Alert          JSP Alert is used to put the validation on login... with Example The Tutorial illustrate an elaborative example to create alert box
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 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
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
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
J2ME Alert Example
J2ME Alert Example      ... to create  alert through sound. In this example we are using AlertType class for the different alert. The AlertType() class has only one method: playSound
Java Alert Box
Java Alert Box In this example we will describe java alert box. First of all we have created class than main method after that we have created alert box... JOptionPane class to display the message alert box.  JOptionPane class is available
SMS alert system using Java - JSP-Servlet
SMS alert system using Java  Respected Sir/Mam, I need to develop an SMS alert application. Scope of the application: Basically... recipients. This can be developed using any kind of componentsThanks
sms/mail alert for dynamic web application
sms/mail alert for dynamic web application  hi friends, how can i integrate sms/mail alert with my dynamic web application created using servlet? can anyone give me any idea for this related coding
Alert Box in Flex
Flex Alert Box Components Adobe Flex provides many types of components, in this tutorial we will study visual component. 1. Alert Box: In the present tutorial we will see how to display simple text using Alert Box. An Alert Box
SMS alert system in Java - JSP-Servlet
SMS alert system in Java  Hi, I have asked this questions 2 days before and awaiting answer. But i didn't get any replies so far?? Any experts please help me
Flex Alert Box example
Flex Alert Box example       Alert box is a dialog box that appears on window with some message and stays rigid until the event associated with it is not done. Alert
https security alert messages - JSP-Servlet
https security alert messages  Hi, I have an application... that link, a security alert message is getting displayed. But initially, I logged into the same application by clicking the security alert and why the same
Alert View with two Buttons
Alert View with two Buttons Project will look like this :     In this tutorial we are going to show alert view, this is shown... as outlet and there is action for the alert view and in .xib file add text field from
A MIDlet Example to execute Alert Message with an Image
A MIDlet Example to execute Alert Message with an Image       In this "Alert Message" example, you will learn how to send an alert message to user whenever an action
User Define Alert Example
User Define Alert Example       Creating a user defined alert message, In the given... to draw string. On clicking Alert option, a alert message will be displayed
Name Display in alert box - JSP-Servlet
Name Display in alert box  Dear Sir, Please any one help me......... when i enter some value in text that value is already in database display the alert box but the value is not in data base alert box is not display
read value from database & alert it is available in database or not
read value from database & alert it is available in database or not  how to read value from text box and alert whether it is available in database or not?   1)availability.jsp: <html> <head> <script type
how to create alert message after data submitted into database
how to create alert message after data submitted into database  I want to create alert message box after data stored into database and redirect to another page, how to do
Accessing Alert Messages through Resource bundle(properties file) in STRUTS2
Accessing Alert Messages through Resource bundle(properties file) in STRUTS2... present i want to know,how to access alert messages through properties files(Resource Bundle) and even wanted to change alert messages in English and french
Display two alert box alternately by clicking on text
Display two alert box alternately by clicking on text In this tutorial , we will discuss about how to display two alert box alternately by clicking on text... on it ,it will show a alert box. But when we click on it again , it shows second alert box
Display alert box on clicking link
Display alert box on clicking link In this tutorial, we will display alert box... a "a href" link. On clicking this link ,a alert box prompt message... to alert box or jQuery. Mylink.html <html> <head> <
code to alert when no checkbox is selected and verify them with orther set
code to alert when no checkbox is selected and verify them with orther set ...".. Now i need a code to throw alert whenc there is no check box selected under the list Attendees and also alert me when the user checks same name under both
How to Display an alert message when nothing is selected in jspinner in java?
How to Display an alert message when nothing is selected in jspinner in java... with the initial value = 0 what i want is if the user did not select the jspinner an alert... minimum", "Alert", JOptionPane.ERROR_MESSAGE); x = 1
autogeneration of a random number and displaying it as a alert message to the user on clicking submit
autogeneration of a random number and displaying it as a alert message to the user on clicking submit  Hi, In my project order purchase system under... on the submit button as a "alert message" and this refrence number act as primary key
how to use confirmation alert box before delete in jsp?
how to use confirmation alert box before delete in jsp?  I use submit button.I want alert box before deleting data.   1)application.jsp: <%@ page import="java.sql.*" %> <html> <head> <script
If statement doesn't work ,(doesn't print alert message when user dont field name and email)
If statement doesn't work ,(doesn't print alert message when user dont field name and email)  I've created some if / else statements to get... { echo ""; echo "alert('Message failed. Please, send an email
How to set left and top positions of alert box using JQuery in the below code?
How to set left and top positions of alert box using JQuery in the below code?  <script> $(document).ready(function() { if(document.getElementById("faxNoId").value=="- -"){ var show=document.getElementById
Mysql Alter Tables
Mysql Alter Tables This example illustrates how to alert the table and how it is used in query. In this example you will see all tables in test database by "show tabels" query. We create a query "ALTER TABLE tutorial
iPhone UIAlertView 
UIAlertView  In this tutorial will learn how to show Alert Box message when text field is empty, Alert box will contain one button i.e. ok button... Application. To show Alert view when text field is empty will add some codes in .h
iPhone AlertView
iPhone AlertView In this tutorial will learn how to show Alert Box in iPhone... is AlertView, is view based Application. To show Alert view when text field is empty will add some codes in .h and .m file and will show Alert view only when
Ajax Registration Program
to validate the user registration through ajax call and then display the alert...;yes" the alert box will show 'Welcome for Register' otherwise it will show...;no"){    alert("Invalid Id/password! Please
Best Vehicle Tracking System
Best Vehicle tracking not just means tracking the vehicle and its location, it involves even the lock system, car-parking assistance and accident alert... of the tracking systems. They send an alert to the system sensing the danger
 

 

 

DMCA.com