Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Value returned from Perl or Javascript?

Reply
Thread Tools

Value returned from Perl or Javascript?

 
 
amerar@iwc.net
Guest
Posts: n/a
 
      01-20-2006

Hi All,

I have a form which has some Javascript validation. On my form there
is a button, and, if that button is selected or clicked, then I want to
set a variable to one value and then pass that along to the Perl/CGI
program. If the button was not clicked, I want to set the variable to
a different value,,,,,,,,,,

If there a way for me to do this? I'm lost on how to return the value
back to the Perl scipt, if my thought process is even
correct.............

Thanks.

 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      01-20-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> I have a form which has some Javascript validation. On my form there
> is a button, and, if that button is selected or clicked, then I want to
> set a variable to one value and then pass that along to the Perl/CGI
> program. If the button was not clicked, I want to set the variable to
> a different value,,,,,,,,,,


<input type="submit" name="mySubmit" value="Submit">

my $q = CGI->new();
my $submit = $q->param('mySubmit');
if (defined $submit) {
print $submit;
}

No need for JavaScript.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
 
 
 
amerar@iwc.net
Guest
Posts: n/a
 
      01-20-2006

David,

Not sure that is what I want. I already have the form with several
buttons and text boxes on it. This particular button has an 'onclick'
event which validates some of the fields. Once that is done, it will
go to the server and run the Perl program.

If this button was clicked, I want to set some sort of variable so I
know in my Perl program that this button was clicked.......

 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      01-20-2006
(E-Mail Removed) wrote:

> Not sure that is what I want.


Not sure what is what you want?

http://www.safalra.com/special/googlegroupsreply/
http://oakroadsystems.com/genl/unice.htm#quote

> I already have the form with several buttons and text boxes on it. This
> particular button has an 'onclick' event which validates some of the
> fields. Once that is done, it will go to the server and run the Perl
> program.


So make sure you are doing that by having it as a submit button, and then
returning true or false from the event handler (and not calling the
submit() method of teh form object).

> If this button was clicked, I want to set some sort of variable so I
> know in my Perl program that this button was clicked.......


And by giving it a unique combination of name and value, as I suggested
previously, that is exactly what you'll be doing.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retrieve the Perl script returned value in C program? Many thanks mike Perl Misc 3 05-01-2007 08:27 PM
Perl threads - capturing value returned from sub Eric Perl Misc 6 02-27-2007 10:01 PM
textbox value not returned in a datagrid Amadelle ASP .Net 1 06-04-2004 11:47 PM
can control call parent & have value returned to it? Jason Shohet ASP .Net 16 05-06-2004 02:26 PM
Error returned while invoking a ".exe" from a perl script Haresh Perl Misc 0 10-10-2003 06:36 AM



Advertisments