perl script

Hi,

I am modifying a perl script

Here is a section

sub forgotten_password		{
print header;
print start_html( -title => $title,  -style => { 'src' => "$web_path$style" }, -onload => "document.loginform.email.focus();" );

Open in new window


I need to get rid of formatting but keep the onload function. The following seems to work, however I would like to know of a way to put the onload command on it's own line.

sub forgotten_password		{
print header ( -onload => "document.loginform.email.focus();" );

Open in new window


thanks for you help.
netplus21Asked:
Who is Participating?
 
ozoConnect With a Mentor Commented:
print "Onload: document.loginform.email.focus();\n"; # is this what you mean?
print "<body onload=\"document.loginform.email.focus();\">\n"; # or this?
0
 
wilcoxonCommented:
What do you mean by "put the onload command on its own line"?  Can you give a (pseudo) code example of what you want?
0
 
netplus21Author Commented:
Wilcoxon: If I want to remove the print header; line, I want to know how to keep -onload => "document.loginform.email.focus();" in the script. Is it possible to place -onload => "document.loginform.email.focus();" on a line, on it's own, or does it have to be preceded by something?
0
 
netplus21Author Commented:
The second command worked for me.
print "<body onload=\"document.loginform.email.focus();\">\n";

Thanks!
0
 
netplus21Author Commented:
Hi, follow up question:

print header() unless $header_flag == 1;
		if ( $header_flag == 2 )		{
			
		}
		else			{
			print start_html( -title => $title,  -style => { 'src' => "$web_path$style" } ) unless $max_quiz_time;
			print start_html( -title => $title,  -style => { 'src' => "$web_path$style" }, -script => $j_script, -onload => "cd();" ) if $max_quiz_time;
		}
		
		header_tm();

Open in new window


I would like to get rid of start_html( -title => $title,  -style => { 'src' => "$web_path$style" } ) and start_html( -title => $title,  -style => { 'src' => "$web_path$style" }

What do I do?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.