page reload question

P

pleaseexplaintome

Hi, I have a perl/cgi script that includes dynamically created
checkboxes and file names. When a given checkbox is checked I move the
related file. how do I redisplay the page without the checkbox and
file name. In other words, I want to reload the page just as if the
user has entered for the 1st time.

i've tried variations of:

<form action="/cgi-bin/page.cgi" method="post" onsubmit="doRefresh()">

function doRefresh(){
location.replace("/cgi-bin/page.cgi");
//location.reload("/cgi-bin/page.cgi");
//location.reload("");
}

Thanks for any help
 
J

J. Gleixner

Hi, I have a perl/cgi script that includes dynamically created
checkboxes and file names. When a given checkbox is checked I move the
related file. how do I redisplay the page without the checkbox and
file name. In other words, I want to reload the page just as if the
user has entered for the 1st time.

i've tried variations of:

<form action="/cgi-bin/page.cgi" method="post" onsubmit="doRefresh()">

function doRefresh(){
location.replace("/cgi-bin/page.cgi");
//location.reload("/cgi-bin/page.cgi");
//location.reload("");
}

Thanks for any help

Wow, that looks so much like JavaScript, instead of perl, it's amazing.

My crystal ball says... if you're using the CGI module, look in the
documentation for 'override'.
 
M

Matt Garrish

Hi, I have a perl/cgi script that includes dynamically created
checkboxes and file names. When a given checkbox is checked I move the
related file. how do I redisplay the page without the checkbox and
file name. In other words, I want to reload the page just as if the
user has entered for the 1st time.

i've tried variations of:

<form action="/cgi-bin/page.cgi" method="post" onsubmit="doRefresh()">

function doRefresh(){
location.replace("/cgi-bin/page.cgi");
//location.reload("/cgi-bin/page.cgi");
//location.reload("");
}

This doesn't make any sense at all. If you're posting back the form to
move the files, why don't you remove the checkboxes from the page you
return in response? You're trying to intercept the post action and
instead reload the page, which means the form the user is submitting
will never get processed.

Matt
 
A

alpha_beta_release

hi

pass the deleted file as parameter, then process it according to the
parameter

Code:
----------------------------------------
my $page = new CGI;

my $content;
if($page->param('file')) {
$content = .....create processed form / something....;
}

#
my $jscript =<<SCRIPT;
function doRefresh(deletedfilename){
location.replace("/cgi-bin/page.cgi?file="+deletedfilename);
}
SCRIPT

print $page->header,
$page->start_html,
$jscript,
$content,
$page->end_html,
----------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,951
Messages
2,570,113
Members
46,700
Latest member
jody1922

Latest Threads

Top