Link to home
Create AccountLog in
Avatar of Neo
NeoFlag 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.
Avatar of wilcoxon
wilcoxon
Flag of United States of America image

What do you mean by "put the onload command on its own line"?  Can you give a (pseudo) code example of what you want?
Avatar of 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
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Neo

ASKER

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

Thanks!
Avatar of 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?