Avatar of Neo
Neo
Flag for Cyprus asked on

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.
Perl

Avatar of undefined
Last Comment
Neo

8/22/2022 - Mon
wilcoxon

What do you mean by "put the onload command on its own line"?  Can you give a (pseudo) code example of what you want?
Neo

ASKER
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?
ASKER CERTIFIED SOLUTION
ozo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Neo

ASKER
The second command worked for me.
print "<body onload=\"document.loginform.email.focus();\">\n";

Thanks!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Neo

ASKER
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?