Forum Moderators: coopster
Any help would be much appreciated. Its only a little thing, but its driving me nuts.
You'll need to look at the script and find the main loop that prints the form input vars. It'll probably be a foreach($_POST as $key => $val) loop.
Inside the loop, BEFORE the print statement, you need to add a line that goes like this:
if ($key == "Submit") continue;
That will make it skip over that iteration in the loop. Just make sure the var name matches what they are already using.
Birdman
I confess that I'm not a coder so struggling a little here. I'm using the NMS FormMail v3.12c - but open to suggestions for any better/more secure/easier to modify script.
I can't find the string you mentioned, but have found the following. I don't know if this help you to help me:
Outputs the form fields to the email body.=cut
sub send_main_email_fields {
my ($self) = @_;foreach my $f (@{ $self->{Field_Order} }) {
my $val = (defined $self->{Form}{$f}? $self->{Form}{$f} : '');$self->send_main_email_field($f, $val);
}
}=item send_main_email_field ( NAME, VALUE )
That's Perl code, which I am still learning. I will take a shot at it though. Be sure to save a copy of the original before editing.
sub send_main_email_fields {
my ($self) = @_;
foreach my $f (@{ $self->{Field_Order} }) {
if ($self->{Form}{$f} == 'Submit'){
my $val = (defined $self->{Form}{$f}? $self->{Form}{$f} : '');
}
$self->send_main_email_field($f, $val);
}
}
If that doesn't work, try posting in the Perl forum and you'll get an answer quickly I imagine.
Birdman
you have something like
<form name="myform" method="post" action="formmail.pl">
<input type="text" name="textbox">
<input type="submit" name="Submit" value="submit">
</form>
if you move the submit button outside of the form, it will not send any data from the button "Submit:submit"
<form name="myform" method="post" action="formmail.pl">
<input type="text" name="textbox">
</form>
<input type="button" name="Submit" value="submit" onclick="document.myform.submit()">