Hello All,

Can anyone please help with one small error I am getting for line 16( The
one which is bold n italic below.)
The error is : Can't call method "str" on an undefined value at firstpage.pl
line 16.


#!/usr/bin/perl
# standard settings plus call for CGI package
#use strict;
#use warnings;
use CGI;
use Bio::Seq;
use Bio::SeqIO;
use Bio::AlignIO;

#subroutine

&validate;

sub validate()
{
   * $q->str=document.form1.login.value; *
    if(str.length > 6)
    {
        $q->number=str.indexOf("@");
        if(number!=-1)
        {
            $q->number=str.indexOf(".");
            if(number==-1)
            {
                $q->document.form1.login.focus();
                alert("Please Enter a valid email id");
                return false;
            }
        }
        else
        {
            $q->document.form1.login.focus();
            alert("Please Enter a valid email id");
            return false;
        }

    }
    else
    {
    $q->document.form1.login.focus();
    alert("Please Enter a valid email id");
    return false;
    }
}

my $q = new CGI;
# generate HTML form using CGI methods
# define type of text
print $q->header("text/html"),
# make page title
$q->start_html(-title=>"Myserver",-BGCOLOR=>"skyblue"),
$q->h1("WEB"),

# produce a headline
$q->h2("Enter your list of sequences"),
# start form for user input.
$q->start_form(
-form => ("/tmp/start_annotator.pdf"),
-method => "post",
-action => "http://localhost/cgi-bin/firstpage.pl";),

# define the method of input plus default value
$q->textfield(
-name => "web",
-input => 'submit',
-value => " "),

$q->submit(-name => "START ANNOTATOR"),

$q->end_form,

$q->start_form(
-form => "form2",
-action => "second_new.pl"
-method => "post"),

$q->textfield(
-name => "Upload",
-input => "button",
-onClick => "return validate()"),

#close form
$q->end_form,
# close HTML page
$q->end_html;

Reply via email to