...

View Full Version : calling javascript file in php



sudhakararaog
01-09-2008, 08:54 PM
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="javascript" type="text/javascript" src="jscripts/erranzregistration.js">
</script>

<form id="form1" name="registrationform" method="post" action="http://website.com/php/confirmegister.php" onSubmit="return 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.

Daniel Israel
01-09-2008, 09:12 PM
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="javascript" type="text/javascript" src="jscripts/erranzregistration.js">
</script>

<form id="form1" name="registrationform" method="post" action="http://website.com/php/confirmegister.php" onSubmit="return 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.

This isn't a PHP problem, you might get better help from the Javascript forum.

shyam
01-10-2008, 12:13 AM
<script language="javascript" type="text/javascript" src="jscripts/erranzregistration.js">
</script>

<form id="form1" name="registrationform" method="post" action="http://website.com/php/confirmegister.php" onSubmit="return validateform()">

are u sure it is not a path problem because the action attribute value gives me the impression register.php and confirmregister.php are on different servers :eek:

SoftDev
01-10-2008, 04:34 AM
Hello Sudhakararaog,

Instead of

<script language="javascript" type="text/javascript" src="jscripts/erranzregistration.js"></script>

use it,

<script language="javascript" type="text/javascript" src="http://website.com/jscripts/erranzregistration.js"></script>

And check whether U get success or not
Enjoy Development:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum