473,403 Members | 2,359 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,403 software developers and data experts.

Problem calling function

Hello,
I have a form. On submit I want a javaScript to check if any fields
are filled in and if so, if the fields that correspond to the filled -
in fields are also filled in.

I wrote a js function which gets called onSubmit.

But I don't have the change to see if the js I wrote works because the
script doesn't even get called - I put an alert('test'); in the first
line of the function definition but after a submit there's no alert:

<form name="form_questions"
method="post"
onSubmit="return checkForm(this);">

[...]

function checkForm(theForm){
alert("inside the function!");
[....]
}

If I put an alert('test'); directly after the onSubmit:
onSubmit="alert('test');">

Here I DO get an alert after form submission.

I have no clue as to what is wrong here since nothing happens. Very
frustrating, I can't continue developing this way.
Could it be a syntax error? Does a debugger exist for javascript code
(win2k)???

Thanks for any tips & help,

Marc
Jul 20 '05 #1
2 1609
In article <ac**************************@posting.google.com >,
me**********@yahoo.com enlightened us with...
I have no clue as to what is wrong here since nothing happens. Very
frustrating, I can't continue developing this way.
Could it be a syntax error? Does a debugger exist for javascript code
(win2k)???

Thanks for any tips & help,


I have had this happen when there is an error in the function. Remove
everything from the function except that alert. If it works then, the
problem is with the code in the function.

Netscape debugs better than IE. Try it in NN7 and type "javascript:" in
the location bar.

-------------------------------------------------
~kaeli~
Jesus saves, Allah protects, and Cthulhu
thinks you'd make a nice sandwich.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #2
me**********@yahoo.com (Marc) writes:
I have no clue as to what is wrong here since nothing happens. Very
frustrating, I can't continue developing this way.
Could it be a syntax error?
Most likely. That would mean that the function isn't declared because
it failed during parsing.
Does a debugger exist for javascript code (win2k)???


Several. Although, all you probably need is useful error messages.
In Opera and Mozilla you can see usable error messages by opening the
Javascript console.
In IE, you can turn on (not very useful) error messages.

If you really want a debugger, here are some:

Venkman for Mozilla:
<URL:http://www.mozilla.org/projects/venkman/>
Netscape Javascript Debugger for Netscape 4:
<URL:http://developer.netscape.com/software/jsdebug-4x.html>
Microsoft Script Debugger:
<URL:http://microsoft.com/downloads/details.aspx?FamilyId=2F465BE0-94FD-4569-B3C4-DFFDF19CCD99&displaylang=en>

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3

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

Similar topics

117
by: Peter Olcott | last post by:
www.halting-problem.com
2
by: Pawan Aggarwal | last post by:
I'm having trouble with calling an exported function in a native DLL compiled with eMbedded Visual C++ in C# application in PocketPC 2002 OS. Problem Description follows: I have one exported...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
1
by: gzannd | last post by:
I have a problem with submitting a form to a PHP page through a dynamically created IFRAME in IE7. This code works fine in Firefox. However, IE7 submits an empty form--the correct PHP page is...
6
by: per9000 | last post by:
An interesting/annoying problem. I created a small example to provoke an exception I keep getting. Basically I have a C-struct (Container) with a function-pointer in it. I perform repeated calls...
6
by: Murray Hopkins | last post by:
Hi. THE QUESTION: How do I get a reference to my Object when processing an event handler bound to an html element ? CONTEXT: Sorry if it is a bit long. I am developing a JS calendar tool....
1
by: =?Utf-8?B?RmFiaWFu?= | last post by:
Hello, I want to give multiple native classes (in different mixed mode dlls) access to a managed output window (for error messages). Therefore I wrote a native singleton with __declspec...
3
by: ShambhuHubli | last post by:
Hi all!! .. I am New member to this group. And also new to C/PYTHON API coding. I am trying to have two way communication i,e i am calling from python to C and then from C to python. I have no...
47
by: mukeshrasm | last post by:
Hi I am calling two pages using Ajax Get_Pages.php and Get_Content.php from combo box. Both pages are displayed based on selection from combo box. Main problem is that it is not showing the...
1
by: JohnCox | last post by:
I have a simple Win32 DLL I wrote named "SimpleLib" that exports two functions. It is written in C++ and compiled with __stdcall (/Gz) and with the preprocessor definition _MBCS (not Unicode). ...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
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,...

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.