Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Frontpage
addins
client
extensions.unix
extensions.windowsnt
programming
programming.com_addins
programming.vba
  
 
date: Mon, 6 Oct 2008 13:01:31 -0700 (PDT),    group: microsoft.public.frontpage.client        back       


Field Validation stops javascript function from executing   
I have a javascript function created by Matt Kruse that creates a
popup calendar that populates my field RequestedDate. It worked fine
until I added a numeric validator on another field (DeclaredValue) on
my form and an integer validator on another field (DockClearance).

Now the popup does not seem to execute. The behavior is consistent in
both Firefox 3.0.3 and IE7.
I do not receive an error in Firefox, but in IE7 I get the following
message. Line 130, char 1, Error:
'document.forms.FreightRequest.RequestedDate' is null or not an
object. Code 0
Where FreightRequest is the name of the form.


If I remove the validators it works again.

Any ideas about what the problem might be.
date: Mon, 6 Oct 2008 13:01:31 -0700 (PDT)   author:   Alan in KY

Re: Field Validation stops javascript function from executing   
I think all you will need to do is change the reference to the form in your script to match the form 
name assigned by FP.
-- 
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage
http://www.Ecom-Data.com
==============================================


"Alan in KY"  wrote in message 
news:8c458279-5bc2-4945-a054-448f8f6bee2d@q9g2000hsb.googlegroups.com...
>I have a javascript function created by Matt Kruse that creates a
> popup calendar that populates my field RequestedDate. It worked fine
> until I added a numeric validator on another field (DeclaredValue) on
> my form and an integer validator on another field (DockClearance).
>
> Now the popup does not seem to execute. The behavior is consistent in
> both Firefox 3.0.3 and IE7.
> I do not receive an error in Firefox, but in IE7 I get the following
> message. Line 130, char 1, Error:
> 'document.forms.FreightRequest.RequestedDate' is null or not an
> object. Code 0
> Where FreightRequest is the name of the form.
>
>
> If I remove the validators it works again.
>
> Any ideas about what the problem might be.
date: Mon, 6 Oct 2008 16:11:44 -0400   author:   Thomas A. Rowe

Re: Field Validation stops javascript function from executing   
On Oct 6, 4:11 pm, "Thomas A. Rowe"  wrote:
> I think all you will need to do is change the reference to the form in your script to match the form
> name assigned by FP.
> --
> ==============================================
> Thomas A. Rowe
> Microsoft MVP - FrontPagehttp://www.Ecom-Data.com
> ==============================================
>
> "Alan in KY"  wrote in messagenews:8c458279-5bc2-4945-a054-448f8f6bee2d@q9g2000hsb.googlegroups.com...
>
> >I have a javascript function created by Matt Kruse that creates a
> > popup calendar that populates my field RequestedDate. It worked fine
> > until I added a numeric validator on another field (DeclaredValue) on
> > my form and an integer validator on another field (DockClearance).
>
> > Now the popup does not seem to execute. The behavior is consistent in
> > both Firefox 3.0.3 and IE7.
> > I do not receive an error in Firefox, but in IE7 I get the following
> > message. Line 130, char 1, Error:
> > 'document.forms.FreightRequest.RequestedDate' is null or not an
> > object. Code 0
> > Where FreightRequest is the name of the form.
>
> > If I remove the validators it works again.
>
> > Any ideas about what the problem might be.

I'm not sure I understand what you mean.
FP didn't assign a name to the form.
And the script will not run unless it has a name.

If you want check out Marscopiers.com
You will not see the javascript since it's in a external js file.
But the calendar popup is in public domain thanks to the wishes of the
author.

Alan
date: Mon, 6 Oct 2008 14:11:56 -0700 (PDT)   author:   Alan in KY

Re: Field Validation stops javascript function from executing   
Reply at bottom

"Alan in KY"  wrote in message 
news:e464c0aa-2c4d-4497-918f-91411b92a20b@y79g2000hsa.googlegroups.com...
On Oct 6, 4:11 pm, "Thomas A. Rowe"  wrote:
> I think all you will need to do is change the reference to the form in 
> your script to match the form
> name assigned by FP.
> --
> ==============================================
> Thomas A. Rowe
> Microsoft MVP - FrontPagehttp://www.Ecom-Data.com
> ==============================================
>
> "Alan in KY"  wrote in 
> messagenews:8c458279-5bc2-4945-a054-448f8f6bee2d@q9g2000hsb.googlegroups.com...
>
> >I have a javascript function created by Matt Kruse that creates a
> > popup calendar that populates my field RequestedDate. It worked fine
> > until I added a numeric validator on another field (DeclaredValue) on
> > my form and an integer validator on another field (DockClearance).
>
> > Now the popup does not seem to execute. The behavior is consistent in
> > both Firefox 3.0.3 and IE7.
> > I do not receive an error in Firefox, but in IE7 I get the following
> > message. Line 130, char 1, Error:
> > 'document.forms.FreightRequest.RequestedDate' is null or not an
> > object. Code 0
> > Where FreightRequest is the name of the form.
>
> > If I remove the validators it works again.
>
> > Any ideas about what the problem might be.

I'm not sure I understand what you mean.
FP didn't assign a name to the form.
And the script will not run unless it has a name.

If you want check out Marscopiers.com
You will not see the javascript since it's in a external js file.
But the calendar popup is in public domain thanks to the wishes of the
author.

Alan


REPLY
=====

Someone assigned the name 'FreightRequest'

And the script *will* run without a name - a numbered reference is 
sufficient

To be more precise,

I did check out marscopier.com and your HTML reads (in part)
<td width="26%">
    <input type="text" value="" name="RequestedDate" size="25">
    <A HREF="#" 
onClick="cal.select(document.forms['FreightRequest'].RequestedDate,'anchor1','MM/dd/yyyy'); 
return false;" NAME="anchor1" ID="anchor1">Select Date</A>
   </td>

Without even looking at CalendarPopup(), this implies that the form 
'FreightRequest' must exist and in it must be a field "RequestedDate"

The only form that I can find is
<form name="FrontPage_Form1".....
and the input field with name="RequestedDate" is in this form.

I suggest changing the form name to 'FreightRequest'

Either that, or do as suggested by the comment in 
http://marscopiers.com/JavaScript/CalendarPopup.js
// This is an example call to the popup calendar from a link to populate an
// input box. Note that to use this, date.js must also be included!!
<A HREF="#" 
onClick="cal.select(document.forms[0].date,'anchorname','MM/dd/yyyy'); 
return false;">Select</A>

document.forms[0] is a reference is to the first (and only) form on the HTML 
page

BTW, I can't see where function FrontPage_Form1_Validator() is called
-- 
Trevor Lawrence
Canberra
Web Site http://trevorl.mvps.org
date: Tue, 7 Oct 2008 10:32:43 +1100   author:   Trevor Lawrence Trevor L.@Canberra

Re: Field Validation stops javascript function from executing   
FYI: The CalendarPopup.js is download to a user's Temporary Internet Files folder.

-- 
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage
http://www.Ecom-Data.com
==============================================


"Alan in KY"  wrote in message 
news:e464c0aa-2c4d-4497-918f-91411b92a20b@y79g2000hsa.googlegroups.com...
On Oct 6, 4:11 pm, "Thomas A. Rowe"  wrote:
> I think all you will need to do is change the reference to the form in your script to match the 
> form
> name assigned by FP.
> --
> ==============================================
> Thomas A. Rowe
> Microsoft MVP - FrontPagehttp://www.Ecom-Data.com
> ==============================================
>
> "Alan in KY"  wrote in 
> messagenews:8c458279-5bc2-4945-a054-448f8f6bee2d@q9g2000hsb.googlegroups.com...
>
> >I have a javascript function created by Matt Kruse that creates a
> > popup calendar that populates my field RequestedDate. It worked fine
> > until I added a numeric validator on another field (DeclaredValue) on
> > my form and an integer validator on another field (DockClearance).
>
> > Now the popup does not seem to execute. The behavior is consistent in
> > both Firefox 3.0.3 and IE7.
> > I do not receive an error in Firefox, but in IE7 I get the following
> > message. Line 130, char 1, Error:
> > 'document.forms.FreightRequest.RequestedDate' is null or not an
> > object. Code 0
> > Where FreightRequest is the name of the form.
>
> > If I remove the validators it works again.
>
> > Any ideas about what the problem might be.

I'm not sure I understand what you mean.
FP didn't assign a name to the form.
And the script will not run unless it has a name.

If you want check out Marscopiers.com
You will not see the javascript since it's in a external js file.
But the calendar popup is in public domain thanks to the wishes of the
author.

Alan
date: Tue, 7 Oct 2008 08:53:40 -0400   author:   Thomas A. Rowe

Re: Field Validation stops javascript function from executing   
On Oct 6, 7:32 pm, "Trevor Lawrence" <Trevor L.@Canberra> wrote:
> Reply at bottom
>
> "Alan in KY"  wrote in messagenews:e464c0aa-2c4d-4497-918f-91411b92a20b@y79g2000hsa.googlegroups.com...
> On Oct 6, 4:11 pm, "Thomas A. Rowe"  wrote:
>
>
>
> > I think all you will need to do is change the reference to the form in
> > your script to match the form
> > name assigned by FP.
> > --
> > ==============================================
> > Thomas A. Rowe
> > Microsoft MVP - FrontPagehttp://www.Ecom-Data.com
> > ==============================================
>
> > "Alan in KY"  wrote in
> > messagenews:8c458279-5bc2-4945-a054-448f8f6bee2d@q9g2000hsb.googlegroups.com...
>
> > >I have a javascript function created by Matt Kruse that creates a
> > > popup calendar that populates my field RequestedDate. It worked fine
> > > until I added a numeric validator on another field (DeclaredValue) on
> > > my form and an integer validator on another field (DockClearance).
>
> > > Now the popup does not seem to execute. The behavior is consistent in
> > > both Firefox 3.0.3 and IE7.
> > > I do not receive an error in Firefox, but in IE7 I get the following
> > > message. Line 130, char 1, Error:
> > > 'document.forms.FreightRequest.RequestedDate' is null or not an
> > > object. Code 0
> > > Where FreightRequest is the name of the form.
>
> > > If I remove the validators it works again.
>
> > > Any ideas about what the problem might be.
>
> I'm not sure I understand what you mean.
> FP didn't assign a name to the form.
> And the script will not run unless it has a name.
>
> If you want check out Marscopiers.com
> You will not see the javascript since it's in a external js file.
> But the calendar popup is in public domain thanks to the wishes of the
> author.
>
> Alan
>
> REPLY
> =====
>
> Someone assigned the name 'FreightRequest'
>
> And the script *will* run without a name - a numbered reference is
> sufficient
>
> To be more precise,
>
> I did check out marscopier.com and your HTML reads (in part)
> <td width="26%">
>     <input type="text" value="" name="RequestedDate" size="25>     <A HREF="#"
> onClick="cal.select(document.forms['FreightRequest'].RequestedDate,'anchor1','MM/dd/yyyy');
> return false;" NAME="anchor1" ID="anchor1">Select Date</A>
>    </td>
>
> Without even looking at CalendarPopup(), this implies that the form
> 'FreightRequest' must exist and in it must be a field "RequestedDate"
>
> The only form that I can find is
> <form name="FrontPage_Form1".....
> and the input field with name="RequestedDate" is in this form.
>
> I suggest changing the form name to 'FreightRequest'
>
> Either that, or do as suggested by the comment inhttp://marscopiers.com/JavaScript/CalendarPopup.js
> // This is an example call to the popup calendar from a link to populate an
> // input box. Note that to use this, date.js must also be included!!
> <A HREF="#"
> onClick="cal.select(document.forms[0].date,'anchorname','MM/dd/yyyy');
> return false;">Select</A>
>
> document.forms[0] is a reference is to the first (and only) form on the HTML
> page
>
> BTW, I can't see where function FrontPage_Form1_Validator() is called
> --
> Trevor Lawrence
> Canberra
> Web Sitehttp://trevorl.mvps.org

Thanks changing the anchor reference to document.forms[0] worked.
I didn't catch the fact that the form name was overwritten with
FrontPage_Form1
I originally called the form FreightRequest.
I haven't worked much with Frontpage. I've been mostly developing web
apps with DNN recently, and prior to that I mostly used Dreamweaver.
So it's the little things that Frontpage does that I'm not aware of.

Again thanks for everyones help.
date: Tue, 7 Oct 2008 14:02:26 -0700 (PDT)   author:   Alan in KY

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us