473,657 Members | 2,993 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why am I getting Javascript (form) or (this.form) errors?


In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmp litude (this.form)">

One of the things the setAmplitude function does is calculate a p1s
value and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve? " onclick="imProv eX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp
--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: do*@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
Mar 24 '07 #1
32 2006
On Sat, 24 Mar 2007 08:51:19 -0700, Don Lancaster <do*@tinaja.com >
Gave us:
>
In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmp litude (this.form)">

One of the things the setAmplitude function does is calculate a p1s
value and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve? " onclick="imProv eX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp

Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities .
Mar 24 '07 #2
MassiveProng wrote:
On Sat, 24 Mar 2007 08:51:19 -0700, Don Lancaster <do*@tinaja.com >
Gave us:

>>In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmp litude (this.form)">

One of the things the setAmplitude function does is calculate a p1s
value and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve? " onclick="imProv eX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp

Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities .
JavaScript 1.1 being developed with Adobe GoLive 5.0.

--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: do*@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
Mar 24 '07 #3
On Mar 24, 10:05 am, MassiveProng
<MassivePr...@t hebarattheendof theuniverse.org wrote:
<input type="button" value="Improve? " onclick="imProv eX
(this.form)">
function imProveX (form) { setAmplitude (this.form) ;
here this refers to the imProveX function and there is no form
property for function. pass the argument to setAmplitude function and
all should be fine.

function imProveX (form) { setAmplitude (form) ;
Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities .
??????????????

Mar 24 '07 #4

"Don Lancaster" <do*@tinaja.com wrote in message
news:56******** *****@mid.indiv idual.net...
>
In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmp litude (this.form)">

One of the things the setAmplitude function does is calculate a p1s value
and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve? " onclick="imProv eX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp

Try:

function imProveX (form) { setAmplitude (form) ; }
Mar 24 '07 #5
On Sat, 24 Mar 2007 09:10:34 -0700, Don Lancaster <do*@tinaja.com >
Gave us:
>MassiveProng wrote:
>On Sat, 24 Mar 2007 08:51:19 -0700, Don Lancaster <do*@tinaja.com >
Gave us:

>>>In an existing, tested and working program, I have a form entry that
simplifies to...

<INPUT name ="fp1s" type="text" value=0.000 size=12 >

and a button of...

<input type="button" value=" Set Amplitude "
onclick="setAmp litude (this.form)">

One of the things the setAmplitude function does is calculate a p1s
value and then does a...

form.fp1s.value = p1s ;

This seems to work fine. I wanted to add a new feature to the program
by adding a new button of

<input type="button" value="Improve? " onclick="imProv eX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp

Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities .

JavaScript 1.1 being developed with Adobe GoLive 5.0.

Could also relate to the runtime engine you are trying to run it
under.
Mar 24 '07 #6
Don Lancaster wrote:
>>In an existing, tested and working program,
I have a form entry that simplifies to...
<INPUT name ="fp1s" type="text" value=0.000 size=12 >
. . .
MassiveProng wrote:
Depends on what version of java you have,
and what you are developing scripts under,
and their co-compatibilities .
One of you two has no idea what he is talking about.
"JavaScript :
The World's Most Misunderstood Programming Language"
by Douglas Crockford
http://66.102.9.104/search?q=cache:g...ggy-*-browsers

Mar 24 '07 #7
ASM
Don Lancaster a écrit :
>
<input type="button" value="Improve? " onclick="imProv eX
(this.form)">

An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
} ;
function imProveX(form) { setAmplitude( form ); }
this.form is already here ------^
and was called in button

To avoid mistakes try to do not use variables named as elements

function imProveX ( something ) { setAmplitude( something ); }
or
function imProveX ( aForm ) { setAmplitude( aForm ); }
This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object
it would have to be : 'form.p1s' is null or not an object

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Mar 24 '07 #8
MassiveProng said the following on 3/24/2007 12:05 PM:
On Sat, 24 Mar 2007 08:51:19 -0700, Don Lancaster <do*@tinaja.com >
Gave us:
<snip>
>An initial function for imProveX was...

function imProveX (form) { setAmplitude (this.form) ;
The this above refers to the function and as such has no property named
"form". If you want to pass it, simply pass the parameter form.
> } ;

This should be doing the same thing the other button does, except from
within a new proc instead of a button click. Instaad, an error of ...

'fp1s' is null or not an object

gets returned.

What am I doing wrong?

The full code appears as http://www.tinaja.com/demo28q.asp


Depends on what version of java you have, and what you are developing
scripts under, and their co-compatibilities .
Has nothing to do with any of that.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 24 '07 #9
MassiveProng said the following on 3/24/2007 12:34 PM:

<snip>
Could also relate to the runtime engine you are trying to run it
under.
No, it relates to scope issues of variables and has nothing to do with
any "runtime engine"

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 24 '07 #10

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

Similar topics

0
1452
by: Ronan | last post by:
Hi, I have a problem with a form using the PHP PEAR HTML_QuickForm package & javascript: I want to record the content of my form into a mySQL database then execute a javascript function. My problem is that javascript is executed before the mySQL insertion. I actually need the mySQL insertion first, since my javascript function
6
4336
by: Charles Banas | last post by:
weird subject - i hope more than just one curious regular will hear me out. :) ok, i've got a bit of a big problem, and i need answers as soon as possible. i know this forum is meant for web developers, but is relevant discussion. i'm not OT here unless someone thinks i'm trolling (which i'm not, obviously). then i'll disappear and never show my face again. :P
12
1551
by: Tom | last post by:
Hi all, I am a newbe to javascript so I could use your help. I checked the FAQs and searched google but I could not resolve this problem. My form is as follows: <form action="serversidehandlerurl.php" method="post" onsubmit="if(document.getelementbyid) { window.open(document.getelementbyid('pblinks').selectedindex.value); return false; }" > <select id="pblinks" size="1" > <option selected="selected" >Select the size...</option>...
2
1568
by: Kenneth | last post by:
Is there anyway to create a javascript function to submit a form in the same html file?
5
1891
by: ojvm | last post by:
ok. thanks again for the time spend reading this. this code adds 2 controls in html form but it places in top of the form. i want this control1 control2 control1 control2 control1 control2
10
6602
by: iam247 | last post by:
Hi In my prototype asp page (with no javascript and no password validation, I have a registration form with the following action: <form name="form" method="post" action="RegDetails.asp"> This works fine, the form details are collected by RegDetails.asp I am attempting to include javascript server side validation for the
2
2835
by: Alex | last post by:
Hi all, I'm writing a small web application which searches a database based on a date field, and populates a datagrid control with the results. The datagrid control has selection buttons added to it to view additional details about the selected result (a second database query is triggered). I want this second query to pop up in a new window, the way it would if I used "window.open" in javascript. I've added a function in the
1
1974
by: news.wanadoo.nl | last post by:
Hi, I have found whit google this form in this group. But i'n not good in javascript :(. I try and error normal but i only error now :P Whit i now want to now how can i get access to the vars vis and inv. Normal when i submit a form then is see something link formhandler?vis=somthing&inv=something. But i dont see that in this form. I want the use data form this form to set it in a databse whit php. I cant get use nog $_GET is wil give...
4
5499
by: ashore | last post by:
Folks, the snippet below errors out on both FF and IE, with FF's error console complaining "this.form has no properties", while a reference to "document.forms.name" works correctly. <form name='whatever1' method = "post" action="javascript:alert(this.form.name);"> <input type="button" value="click" onClick = "this.form.submit();"/> </form> Any ideas welcome,
0
8718
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8499
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8601
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7314
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5630
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.