Alert???? 
March 4th, 2008, 05:45 PM
| | | 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. | 
March 4th, 2008, 06:05 PM
| | | 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. | 
March 4th, 2008, 06:05 PM
| | | 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) | 
March 4th, 2008, 10:45 PM
| | | 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. | 
March 5th, 2008, 07:35 AM
| | | 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) | 
March 5th, 2008, 11:05 AM
| | | 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 | 
March 5th, 2008, 01:15 PM
| | | 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. | 
March 5th, 2008, 05:25 PM
| | | 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. | 
March 5th, 2008, 10:35 PM
| | | 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. | 
March 5th, 2008, 10:35 PM
| | | Re: Alert????
In article <47CE7EF7.9080604@PointedEars.de>, Thomas 'PointedEars' Lahn <cljs@PointedEars.dewrote: <
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. | 
March 6th, 2008, 07:15 AM
| | | 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) | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 220,989 network members.
|