473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Value returned from Perl or Javascript?


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.

Jan 20 '06 #1
3 1466
am****@iwc.net 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
Jan 20 '06 #2

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

Jan 20 '06 #3
am****@iwc.net 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
Jan 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: PvdK | last post by:
Hello, I have a form in which the user can enter a query in a query language. The form is submitted to a perl script that checks if the syntax is OK and if yes, execute the query and generates...
1
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
3
by: Robert Brown | last post by:
Hi All.. What I have is a normal ASP web page wih javascript. The javascript needs to call a payment gateway, but the only way to get to it is https://paymentgateway/external.pl with parameters....
8
by: DaKoadMunky | last post by:
Please consider the following... <CODE> #include <string> using namespace std; typedef int PrimitiveType; typedef string ClassType;
5
by: Robert Oschler | last post by:
I am converting a Perl script over to "C" for a potential open source project. I need some open source "C" code that will give me the same functionality of a Perl Style associative array: ...
7
by: ravi | last post by:
Hi, I am a newbie to javascript. Iam working on a page that has two radio buttons and a tree. I do not have my tree nodes to be selectable. Iam working on Firefox. I have the firebug...
8
by: Samik R. | last post by:
Hello, I am using the innerHTML property of a div placeholder to update the contents, and the HTML is provided from a perl script on the server side. The perl script gets called through AJAX when I...
6
by: =?Utf-8?B?Um9i?= | last post by:
Hi, If I call my own DLL from Javascript, a HRESULT is returned. Javascript cannot cast this to an integer. Is there any other way of typecasting this returnvalue to integer, wihout using the...
1
by: satish2112 | last post by:
Hi, I have a text-area which contains values from mysql database and 2 buttons, Edit and Update. When I click on the Edit button, I can edit the text-area (initially non-editable). After this,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.