473,385 Members | 1,901 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.

Alert????


Hello,

I am trying to figure out the functionality of alert in javascript. I
have a form with about 5 fields. Each field has a check on whether the
information entered is valid. If the user enters an invalid
information, a alert box pops up. My problem is, if I say OK on the
alert box, the entire page is refreshed. Is there any way in which
only that particular field (in which invalid information is entered)
is refreshed and the remaining fields are as they were?

Thanks in advance.
Dimple.
Mar 4 '08 #1
10 1735
On Tue, 04 Mar 2008 10:43:14 -0800, dimple.nshah wrote:
I am trying to figure out the functionality of alert in javascript. I
have a form with about 5 fields. Each field has a check on whether the
information entered is valid. If the user enters an invalid information,
a alert box pops up. My problem is, if I say OK on the alert box, the
entire page is refreshed. Is there any way in which only that particular
field (in which invalid information is entered) is refreshed and the
remaining fields are as they were?

Without code, I can only guess as to the issue.

My first guess is not returning false from an event handler.

That said, Alert tends to be an awkward and annoying way to handle entry
errors, ESPECIALLY if done on a field-by-field basis.
Mar 4 '08 #2
wrote on 04 mrt 2008 in comp.lang.javascript:
I am trying to figure out the functionality of alert in javascript. I
have a form with about 5 fields. Each field has a check on whether the
information entered is valid. If the user enters an invalid
information, a alert box pops up. My problem is, if I say OK on the
alert box, the entire page is refreshed. Is there any way in which
only that particular field (in which invalid information is entered)
is refreshed and the remaining fields are as they were?
Yes and no.

Yes it is possible and No that would not be called refresh.
The discussion however is meaningless without you showing your code.
Please only show the essential part.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 4 '08 #3
In article <e4**********************************@60g2000hsy.g ooglegroups.com>, di**********@gmail.com wrote:
>You mean I need to check if the date is in proper format, inside HTML
itself???
No, in your javascript.

--
Regards,
Doug Miller (alphageek at milmac dot com)

It's time to throw all their damned tea in the harbor again.
Mar 4 '08 #4
Doug Miller wrote on 05 mrt 2008 in comp.lang.javascript:
Irrelevant. No form should ever ask for today's date.
You "ever" is wrong,
there are many instances where it is apropriate to do so.

In medicine it is one of the first questions asked to estimate the
client/patient's desorientation. It could be used to correct errors with
the computer's clock off line, or to set a virtual reality time in a
simulation.

Speaking about a form [or a letter] asking is a strong humanisation,
a form is just a instrument of asking, but I like that. ;-)

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 5 '08 #5
Tim Streater wrote:
In article <47**************@PointedEars.de>,
Thomas 'PointedEars' Lahn <Po*********@web.dewrote:
>Doug Miller wrote:
>>[...] Thomas 'PointedEars' Lahn [...] wrote:
Doug Miller wrote:
[...] di**********@gmail.com wrote:
>I am actually writing date validation. Here is the scripting part:
>>
>// Date Validation for Today's Date (date should be in mm/dd/yyyy
>form)
Date input formats on an international medium like the Web should follow
internationally standardized formats, such as ISO 8601 (YYYY-MM-DD), or
provide a control for every date component.

No, I want it in my local format.
Irrelevant. Several million other people have ISO 8601 as their local
format. However, L10n could include an option for user-defined display.
The point was, it is a bad idea for a Web application to use the localized
format *by default*.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Mar 5 '08 #6
In article <47**************@PointedEars.de>,
Thomas 'PointedEars' Lahn <Po*********@web.dewrote:
Tim Streater wrote:
In article <47**************@PointedEars.de>,
Thomas 'PointedEars' Lahn <Po*********@web.dewrote:
Doug Miller wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
Doug Miller wrote:
[...] di**********@gmail.com wrote:
I am actually writing date validation. Here is the scripting part:
>
// Date Validation for Today's Date (date should be in mm/dd/yyyy
form)
Date input formats on an international medium like the Web should follow
internationally standardized formats, such as ISO 8601 (YYYY-MM-DD), or
provide a control for every date component.
No, I want it in my local format.

Irrelevant. Several million other people have ISO 8601 as their local
format. However, L10n could include an option for user-defined display.
The point was, it is a bad idea for a Web application to use the localized
format *by default*.
Why? I would call it a good idea for the page to consult my local
settings for date format display.
Mar 5 '08 #7
In comp.lang.javascript message <83e90c08-bb1e-4942-8a70-7fa5ba510145@s3
7g2000prg.googlegroups.com>, Tue, 4 Mar 2008 11:01:48,
di**********@gmail.com posted:
>
I am actually writing date validation.
If you had read the newsgroup FAQ with reasonable care before the
relevant line was removed, you would have been lead to a much more
concise way of validating a numeric Y M D date in JavaScript. See
below.

A Google search for JavaScript date validation will soon show that
there's no need to write new bad code, since the Web offers plenty; and
will give you an idea of the quality of the average web tutorial.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk IE6 IE7 FF2 Op9 Sf3
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Mar 5 '08 #8
In article <Xn********************@194.109.133.242>, "Evertjan." <ex**************@interxnl.netwrote:
>Doug Miller wrote on 05 mrt 2008 in comp.lang.javascript:
>Irrelevant. No form should ever ask for today's date.

You "ever" is wrong,
there are many instances where it is apropriate to do so.
Too bad you failed to provide any.
>
In medicine it is one of the first questions asked to estimate the
client/patient's desorientation.
Nonsense. While you're right about the question, you've completely
misunderstood its significance: the information being entered into the
medical record is not "today's date" but rather "what the patient THINKS is
today's date".

Strike one.
It could be used to correct errors with
the computer's clock off line,
Garbage. Correcting errors with the computer's clock would be done so by
setting the clock directly, not by entering the date into a form on a web
page.

Strike two.
>or to set a virtual reality time in a
simulation.
A VR sim using javascript in a web browser?

Strike three. You're out.
Mar 5 '08 #9
In article <47**************@PointedEars.de>, Thomas 'PointedEars' Lahn <cl**@PointedEars.dewrote:
>[flame snipped]
>
<
Pedant. This is of course going to be the case the vast majority of the time,
as you are doubtless aware. In any event it's certainly easy enough to display
what the computer thinks (is that better?) is today's date as a default value.

The point remains that requiring the user to type in *any* information that
can be determined in advance by the software, especially something so simple
and straightforward as today's date, is asinine.
>
Your conspicuous failure to address these points is noted without surprise.
Mar 5 '08 #10
Doug Miller wrote on 06 mrt 2008 in comp.lang.javascript:
In article <Xn********************@194.109.133.242>, "Evertjan."
<ex**************@interxnl.netwrote:
>>Doug Miller wrote on 05 mrt 2008 in comp.lang.javascript:
>>Irrelevant. No form should ever ask for today's date.

You "ever" is wrong,
there are many instances where it is apropriate to do so.

Too bad you failed to provide any.
>>
In medicine it is one of the first questions asked to estimate the
client/patient's desorientation.

Nonsense. While you're right about the question, you've completely
misunderstood its significance: the information being entered into the
medical record is not "today's date" but rather "what the patient
THINKS is today's date".

Strike one.
>It could be used to correct errors with
the computer's clock off line,

Garbage. Correcting errors with the computer's clock would be done so
by setting the clock directly, not by entering the date into a form on
a web page.

Strike two.
>>or to set a virtual reality time in a
simulation.

A VR sim using javascript in a web browser?

Strike three. You're out.
Your game is your private virtual reality.

I am glad for you, you feel happy having strikes.
However for me this is not a game,
not even a game I do not know or want to know,
I was talking about reality.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 6 '08 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: optimistx | last post by:
How to write a function f(x) or f('x') so that it produces the same output as a call to alert-function: var x='abc'; alert('x='+x); In testing one needs to write similar alert() calls...
2
by: schieco | last post by:
The following code always prints the debug lines inside the conditional if statement before and after the alert statement when the session has timed out, but the alert and redirect only appear/work...
4
by: hugo2 | last post by:
Most of these characters are not on the standard keyboard. Here's a successful contrivance, with comments & cautions, a little page that works in IE6. <HTML><HEAD><SCRIPT TYPE="text/javascript">...
11
by: Alistair Saldanha | last post by:
I'm looking for the event that is fired by Internet Explorer to an "alert": <SCRIPT> Alert("You already have a session open") </SCRIPT> The event would be webBrowser.Document.???? Much...
0
by: Stephanie | last post by:
I have a problem with an Alert that is supposed to invoke a Job. Here are some details: Windows Server 2000 SQL Server Standard Ed. ver. 8.00.818 (Sp3) Alert: SQL Server performance condition...
3
by: umdsasha | last post by:
So, basically, I need to detect whether an alert window was thrown. I can't find where it's thrown from but I need to disable a button only if there were no alert windows thrown. Any ideas? ...
4
by: joe | last post by:
Hi, I defined: <div id="abc"> </div> in my .html file, after an Ajax query my weberserver sends: <script language="JavaScript"> alert('Hello World!"); </script>
5
by: vjsv2007 | last post by:
Can you help to make one alert with all details? <script type="text/javascript"> <!-- function validate_form ( ) { valid = true;
24
by: Jeremy J Starcher | last post by:
While reading c.l.j, I've noticed that some people prefer and indeed even recommend the use of "window.alert()" over "alert()". I can't find any technical reason to make this distinction, and...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.