Advanced Search

Results 1 to 2 of 2

Thread: Screen shows blank after submit button clicked

  1. #1
    Join Date
    Jun 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Screen shows blank after submit button clicked

    Following are my webpage which include javascript code. To check I press submit button without inserting any record, but all the browser shows blank screen, what could be the reason
    Code:
    <!DOCTYPE html>
    
    <html lang="en">
        <head>
                   <title>User Registration Page of SPINFONET.COM</title>
            <link rel="stylesheet" type="text/css" href="homepage.css">
    <meta name="description" content="Website for Jobs,Matrimony,Property listing in  India."/>
    <meta name="keywords" content="Jobs, searching jobs, jobsearch,jobs in india, Brides,Brides and groom search, House,Flat,Plots,Bunglows,Industrial sheds search,property search"/>
    <meta name="keyphrase" content="Job search,Property search, Bride and groom search"/>
    <meta name="Title" content="Search Jobs,matrimony, property in India"/>
    <meta name="Owner" content="spinfonet.com"/>
    <meta name="Author" content="spinfonet.com"/>
    <meta name="classification" content="Jobs,matrimony,property search in india, Online search"/>
    <meta name="distribution" content="global"/>
    <meta name="rating" content="General"/>
    <meta name="subject" content="Jobs, Matrimony,property search in idnai"/>
    <meta name="page-type" content="Jobs,matrimony,property - India"/>
    <meta name="audience" content="all"/>
    <meta name="robots" content="all"/>
    <meta name="language" content="English"/>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
    <meta name="robots" content="noodp"/>
    <script type="text/javascript">
    function validateForm()
     {
     var x=document.forms["jobseekeruser"]["username"].value;
     if (x==null || x=="")
       {
       alert("User name must be filled out");
       return false;
          }
    	  {
    	 var userexp = /^[a-z0-9_-]{5,16}$/
    	 if( !userexp.test(document.jobseekeruser.username.value))
     
    alert("Enter valid username with character,number,uderscorer or dot");
     else
    alert("Name entered successfully");
     
    }
    
    var p=document.forms["jobseekeruser"]["password"].value;
    if(p==null || p== "")
    {
     alert("Password must be filled out");
     var passexp = /^[a-z0-9@]{5,16}$/
     if(!passexp.test(document.jobseekeruser.password.value))
     alret("Enter valid password with character '@' number");
     else
     alert("Password entered successfully");
     }
      var m=document.forms["jobseekeruser"]["emailid"].value;
     if (m==null || m=="")
     {
      alert(Emailid must be filled out");
      return false;
      }
      {
       var mexp =/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
       if(!mexp.test(document.jobseekeruser.emailid.value))
       alert("Enter Valid username")
       else
       ("OK Emailid is correct")
       }
     }
    </script
        </head>
        <body>
            <img alt="S p logo.jpg" src="S p logo.jpg" height="200" width="200" />
    <div class="topnav">
    <ul>
    <li><a href="http://www.spinfonet.com/index.html">Home</a></li>
    <li><a href="http://www.spinfonet.com/jobseeker.html">jobseeker</a></li>
    <li><a href="http://www.spinfonet.com/jobseekeruser.html">Newuser</a></li>
    </ul>
    </div>
    <div class="usertable">
    <form action="jobseeker.php" name="jobseekeruser" onsubmit="return validateForm()"  method="post">
    <table>
    <tr>
    <td>Username         :*</td>
    <td><input type="text" name="username"></td>
    </tr>
    <tr>
    <td>Password         :*</td>
    <td><input type="password" name="password"></td>
    </tr>
    <tr>
    <td>Emailid          :*</td>
    <td><input type="text" name="emailid"></td>
    </tr>
    <tr>
    <td><input type="submit" value="Submit" /></td>
    <td><input type="reset" value="Reset"</td>
    </tr>
    </form>
    </body>
    </html>
    Last edited by jscheuer1; 06-02-2013 at 04:09 PM. Reason: Format

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    27,636
    Thanks
    42
    Thanked 2,896 Times in 2,868 Posts
    Blog Entries
    12

    Default

    There could also be other problems, but there's a syntax error here:

    Code:
      var m=document.forms["jobseekeruser"]["emailid"].value;
     if (m==null || m=="")
     {
      alert(Emailid must be filled out");
      return false;
      }
    You need an opening " mark:

    Code:
      var m=document.forms["jobseekeruser"]["emailid"].value;
     if (m==null || m=="")
     {
      alert("Emailid must be filled out");
      return false;
      }
    Then here:

    Code:
       var mexp =/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
       if(!mexp.test(document.jobseekeruser.emailid.value))
       alert("Enter Valid username")
       else
       ("OK Emailid is correct")
       }
     }
    </script
    Should be:

    Code:
       var mexp =/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
       if(!mexp.test(document.jobseekeruser.emailid.value))
       alert("Enter Valid username")
       else
       alert("OK Emailid is correct")
       }
     }
    </script>


    The browser cache may need to be cleared and/or the page refreshed to see changes.
    Last edited by jscheuer1; 06-02-2013 at 04:45 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Similar Threads

  1. recognizing if submit button is clicked
    By terrys in forum Looking for such a script or service
    Replies: 11
    Last Post: Yesterday, 08:01 PM
  2. Replies: 11
    Last Post: 09-29-2012, 12:47 AM
  3. Resolved blank screen when no requests!
    By liamallan in forum PHP
    Replies: 16
    Last Post: 04-15-2010, 07:42 PM
  4. php script shows blank page
    By matthewbluewars in forum PHP
    Replies: 11
    Last Post: 05-01-2008, 11:37 PM
  5. Just a blank screen
    By JRF2k in forum PHP
    Replies: 10
    Last Post: 03-19-2008, 06:25 PM

Bookmarks

Posting Permissions

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