473,385 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to can show alert after empty text field is submitted?

How we can show alert (Please enter your name) after the clear text field.
Nov 3 '10 #1
1 2261
acoder
16,027 Expert Mod 8TB
Post your code.

Access the element using document.getElementById() and then check if it's empty:
Expand|Select|Wrap|Line Numbers
  1. if (textbox.value == "") 
You may also want to trim the value of spaces before checking.
Nov 4 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: T.E. | last post by:
Hi all, I'm a newbie in php. I encounter a problem with php form that has only one textfield. If I click on the submit button, the form works fine. However, when I press 'enter', the form...
4
by: Michael | last post by:
Hi, I am writting a ASP which will accept lots of data from user interface page. Is there a way that show me the each field or key name and value? For example; From the user interface page, ...
20
by: WindAndWaves | last post by:
Hi Gurus I was wondering if you can send me in the right direction: I have a table with about 300 rows. I want to make all of them invisible and when a user enters a code in a form then make...
0
by: ashucl | last post by:
If you wan't to define the definitions of the member functions out side the class you do : class name::function name() { } in Visual Studio IDE it gives a list of all the functions in the...
1
by: Peter Bailey | last post by:
Thanks to the news group I can now clear a list box. The default value in properties of the combo is set to "please select a year". the code Me.CBDOSYear = Me.CBDOSYear.ItemData(0) however...
3
by: toufik | last post by:
Hi, In my winform, I bind the controls to a dataview DV1 that is created on a datatable TABLE1, The problem is the I loose the binding when I refill the datatable (CLEAR(),...
4
by: GrumPlayer | last post by:
Does anyone have a script for this? I want to use it to put these things into a logfile or db. Thanks
2
by: Giridhara | last post by:
hi can any one help me in a text field im featching value from database,if i change the value in same i need to show alert msg
3
by: Kuldeep | last post by:
Framework: Visual Studio 2005 Technology: ASP.NET 2.0 Language: C#.NET 2.0 Hi All, I have an event procedure as shown below. protected void lnkBtSendEmail_Click(object sender, EventArgs e)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.