Connecting Tech Pros Worldwide Help | Site Map

Alert????

  #1  
Old March 4th, 2008, 06:45 PM
dimple.nshah@gmail.com
Guest
 
Posts: n/a

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.
  #2  
Old March 4th, 2008, 07:05 PM
Jeremy J Starcher
Guest
 
Posts: n/a

re: Alert????


On Tue, 04 Mar 2008 10:43:14 -0800, dimple.nshah wrote:
Quote:
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.
  #3  
Old March 4th, 2008, 07:05 PM
Evertjan.
Guest
 
Posts: n/a

re: Alert????


wrote on 04 mrt 2008 in comp.lang.javascript:
Quote:
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)
  #4  
Old March 4th, 2008, 11:45 PM
Doug Miller
Guest
 
Posts: n/a

re: Alert????


In article <e4ec66ad-92a0-425b-a5c9-d7ef1c0e4fa8@60g2000hsy.googlegroups.com>, dimple.nshah@gmail.com wrote:
Quote:
>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.
  #5  
Old March 5th, 2008, 08:35 AM
Evertjan.
Guest
 
Posts: n/a

re: Alert????


Doug Miller wrote on 05 mrt 2008 in comp.lang.javascript:
Quote:
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)
  #6  
Old March 5th, 2008, 12:05 PM
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a

re: Alert????


Tim Streater wrote:
Quote:
In article <47CE7EF7.9080604@PointedEars.de>,
Thomas 'PointedEars' Lahn <PointedEars@web.dewrote:
Quote:
>Doug Miller wrote:
Quote:
>>[...] Thomas 'PointedEars' Lahn [...] wrote:
>>>Doug Miller wrote:
>>>>[...] dimple.nshah@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
  #7  
Old March 5th, 2008, 02:15 PM
Tim Streater
Guest
 
Posts: n/a

re: Alert????


In article <47CE8B82.1080400@PointedEars.de>,
Thomas 'PointedEars' Lahn <PointedEars@web.dewrote:
Quote:
Tim Streater wrote:
Quote:
In article <47CE7EF7.9080604@PointedEars.de>,
Thomas 'PointedEars' Lahn <PointedEars@web.dewrote:
Quote:
Doug Miller wrote:
>[...] Thomas 'PointedEars' Lahn [...] wrote:
>>Doug Miller wrote:
>>>[...] dimple.nshah@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.
  #8  
Old March 5th, 2008, 06:25 PM
Dr J R Stockton
Guest
 
Posts: n/a

re: Alert????


In comp.lang.javascript message <83e90c08-bb1e-4942-8a70-7fa5ba510145@s3
7g2000prg.googlegroups.com>, Tue, 4 Mar 2008 11:01:48,
dimple.nshah@gmail.com posted:
Quote:
>
>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.
  #9  
Old March 5th, 2008, 11:35 PM
Doug Miller
Guest
 
Posts: n/a

re: Alert????


In article <Xns9A586097F1762eejj99@194.109.133.242>, "Evertjan." <exjxw.hannivoort@interxnl.netwrote:
Quote:
>Doug Miller wrote on 05 mrt 2008 in comp.lang.javascript:
>
Quote:
>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.
Quote:
>
>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.
Quote:
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.
Quote:
>or to set a virtual reality time in a
>simulation.
A VR sim using javascript in a web browser?

Strike three. You're out.
  #10  
Old March 5th, 2008, 11:35 PM
Doug Miller
Guest
 
Posts: n/a

re: Alert????


In article <47CE7EF7.9080604@PointedEars.de>, Thomas 'PointedEars' Lahn <cljs@PointedEars.dewrote:
Quote:
Quote:
>[flame snipped]
Quote:
>
<
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.
Quote:
>
Your conspicuous failure to address these points is noted without surprise.
  #11  
Old March 6th, 2008, 08:15 AM
Evertjan.
Guest
 
Posts: n/a

re: Alert????


Doug Miller wrote on 06 mrt 2008 in comp.lang.javascript:
Quote:
In article <Xns9A586097F1762eejj99@194.109.133.242>, "Evertjan."
<exjxw.hannivoort@interxnl.netwrote:
Quote:
>>Doug Miller wrote on 05 mrt 2008 in comp.lang.javascript:
>>
Quote:
>>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.
Quote:
>>
>>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.
>
Quote:
>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.
>
Quote:
>>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)
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why "window.alert()" over "alert()"? Jeremy J Starcher answers 24 August 26th, 2008 09:45 PM
Detect whether javascript threw an alert window (with javascript) umdsasha@gmail.com answers 3 August 24th, 2006 07:15 AM
Displaying upper ASCII (code 128-255) in alert() window. hugo2 answers 4 July 23rd, 2005 07:20 PM
Alert not working in IE6 some cases schieco answers 2 July 23rd, 2005 11:25 AM
alert('x='+x) optimistx answers 15 July 23rd, 2005 11:09 AM