Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Posts
    137
    Thanks
    1
    Thanked 0 Times in 0 Posts

    calling javascript file in php

    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.

  • #2
    Regular Coder
    Join Date
    Aug 2006
    Location
    Richmond, CA
    Posts
    182
    Thanks
    3
    Thanked 10 Times in 9 Posts
    Quote Originally Posted by sudhakararaog View Post
    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.

  • #3
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    Quote Originally Posted by sudhakararaog View Post
    <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
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #4
    New Coder
    Join Date
    Dec 2007
    Location
    India
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •