473,653 Members | 2,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

calling javascript file in php

54 New Member
i have a register.php and confirmregister .php file. in the first file the user fills a registeration form and in the second page they can review what they

entered in the first page and then confirm their registration.

in register.php i am able to call a javascript file which does the validation of the form fields.

<script language="javas cript" type="text/javascript" src="jscripts/erranzregistrat ion.js">
</script>

<form id="form1" name="registrat ionform" method="post" action="http://website.com/php/confirmegister. php" onSubmit="retur n validateform()" >

however in the confirmegister. php file i am using the same script tag and the same form tag but the javascript file is not being called at all.

please advice how i can call the javascript file in confirmregister .php file.

thanks.
Jan 9 '08 #1
1 1627
nathj
938 Recognized Expert Contributor
i have a register.php and confirmregister .php file. in the first file the user fills a registeration form and in the second page they can review what they

entered in the first page and then confirm their registration.

in register.php i am able to call a javascript file which does the validation of the form fields.

<script language="javas cript" type="text/javascript" src="jscripts/erranzregistrat ion.js">
</script>

<form id="form1" name="registrat ionform" method="post" action="http://website.com/php/confirmegister. php" onSubmit="retur n validateform()" >

however in the confirmegister. php file i am using the same script tag and the same form tag but the javascript file is not being called at all.

please advice how i can call the javascript file in confirmregister .php file.

thanks.
Hi,

Are register.php and confirmregister .php in the same directory? as the path for the script is relative from where these files are located.

Try using full paths for the source of the javescript file. This may solve the problem

Cheers
nathj
Jan 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
4514
by: Julia Briggs | last post by:
Hello World - I admit I'm new to javascript but I've tried for days to find a solution to my problem. Basically I have 3 unique javascript files that do different screen display events that I want to dynamically call, where the current page would then refresh after a user clicks on any one of three associated button links. Could someone please assist me and craft a simple script that would accomplish this feat of impossibility? ...
7
1640
by: JCO | last post by:
I have several JavaScripts in a web page. Each script is in an individual file with extension .js. I want to know if it is possible to put all functions in one single page. If so, how do I call the specific script that I want to run. This is how I call an individual script: <SCRIPT LANGUAGE="JavaScript" src="valForm.js"></SCRIPT> Where valForm is a script that looks like this: function valForm()
3
2657
by: Rajesh | last post by:
Hi, I am using iplanet webserver 4.1. I want to call a java class from ssjs file. But I am not getting the result. I have created a java class file and put it in the folder <Server>\Netscape\Server4\bin\https\jar folder. But I am not sure whether it is the right location to put the class file. Also I would like to know how to put the class file in jar format. The Java file and the ssjs file code given below. Java part package pdfbase;
5
2212
by: sfeher | last post by:
Hi, Is there a way to know when a function is available for me to call it from a dynamically loaded a javascript? I use this code to load the include.js file and then I call testIncludeFn() from it: <code>
4
2813
by: Adam Smith | last post by:
Hello, How can I call or trigger an external javascript twice in a form? I have <script language="JavaScript" src="country_state.js" name="Country_State"> <script type="text/javascript" src="country_state.js"> </script>
6
10618
by: Ajit Goel | last post by:
Hi; We have a Javascript function which I have been tasked to move to a CSharp class. This javascript function uses Regular expression extensively. This function has a string input parameter and output parameter. My questions are: a. Can I expose a function in my CSharp code and internally call a javascript function?? Is this a good idea?? b. Do we have any tool which can convert a javascript function into
2
7656
by: moni | last post by:
Hi, I wanted to call a javascript function function showAddress(address) { ..... } from the aspx.cs file from the Gridview_RowCommand function
1
2406
by: Memphis Steve | last post by:
Is it possible to combine multiple javascipts into one file and then call that file from a linked URL in the head section of an XHTML file? Here are the two scripts I want to use with the instructions on where to normally place them in an XHTML document: SCRIPT #1: Step 1: Insert the below anywhere into the <body> section of your page where you wish the clock to be displayed:<script> /* Live Date Script-
4
2455
by: r_ahimsa_m | last post by:
Hello, I am learning WWW technologies in Linux. I created index.html file which I can browse with Firefox/Konqueror using URL localhost/~robert/rozgloszenia/index.html. The page looks fine but there's one strange problem: I have written some JavaScript code in functions.js file which seems to be ignored when called although I have JavaScript enabled in Firefox/Konqueror. For example in functions.js I have:
9
3018
by: mrcheeky | last post by:
Hi, I'm stuck, but it's almost working! From a html page, my javascript calls a server-side php script. The php reads a value from a server-side .txt file and passes it back as a javascript variable. This all works fine. However, I want it to loop within a javascript function every 5 seconds. The function does other stuff, so looping within this function is essential (I've simplified it in the example below). Any advice would be...
0
8370
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8283
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8470
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,...
1
6160
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
5620
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
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2707
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.