ezincenter
Dec 10 2004, 11:30 PM
Hey everyone, got a problem with a Perl script I'm trying out. In my Perl script, I have the user input a number to dynamically display a number of text form fields in which they enter figures. At the bottom, there will be a button to give the sum of all the numbers in the text fields--that's where I'm stuck, I got the text boxes to show up alright, but that's about it. I thought I might use JavaScript, but that didn't turn out to well. I was thinking of using arrays for the name referencing in the javascript part, but I couldn't figure that out either. Here's the script Code: QUOTE #!/usr/bin/perl -w use CGI; $query = new CGI; $JSCRIPT=<<EOF; // Any JavaScript Ideas?? EOF ; print $query->header,"\n"; print $query->start_html(-title=>'JavaScript Summations',-script=>$JSCRIPT),"\n"; print "<h1>Choose to add up a Summation of costs</h1>\n"; print $query->p, "Just enter in the number of items you will need to include then hit "Submit Query" to get the form boxes","\n"; print $query->start_form(-name=>'formA', -method=>'get'),"\n"; print "<p>How many items?\n"; print $query->textfield('item'),"<br />\n"; print $query->submit,$query->reset,"</p>\n"; $list = $query->param('item'); print "<ol>\n"; for (1..$list) { print qq{ <li>Input a cost(\$): <input name=\"field$_\" type=\"text\" /></li>\n}; } print "</ol>\n\n"; print "<input type=\"button\" value=\"Get Sum\" onclick=\"doSum()\" \/>\n\n"; print $query->end_form,"\n\n"; print $query->end_html;
This is like my second serious Perl script and I couldn't think of the syntax that would accomplish my task--I wouldn't even know how to search for it really, but I'll continue to play around with ideas. Thanks, in advance, for any help. Best regards, ezincenter
Reply
Similar Topics
Keywords : perl script- Help Needed To Create Login Script With Perl/cgi
- Need Script (21)
Have a format in mind and have a good idea how it works. So here what I need: step 1::: person must
register: create handle // enter password // enter password // enter email : it then takes the
person to acsepted page or reject per reason page. step 2::: login page: enter handle // enter
password : takes them on it to the site of their control pages for each handle controls their own
pages yet all pages interacts with the others. or bad password re login page. Have the page
designed already have the script in html lang but one can create a password on the html page but...
Perl : Help
- How to run command lines (4)
Hi there , I would like to have help with Perl. When I make a program and I run it , it close
instantly after it is done. So how could I keep it open after his execution ? And also , where can
I find Perl command lines ( if it exists for sure ) Thanks everyone , Happy new year. Mathieu_021...
Maximum Number Of Decimal Places In Perl Language
- (0)
Perl Programming Language
- (1)
Hi, I want to use a big number in perl programming language. Unfortunately, my perl software does
not support "BIGNUM". Is there another way to replace "BIGNUM" to solve my problem. Thank you for
your feedback. ...
Just Learning Perl
- (6)
Okay so I've decided to learn PERL. As I am VERY burned out on PHP after making an online
hacking game in it and working on it for a month after release. Now that its almost done other than
maintenance. I'm VERY good at php now. However I tried to do C and quickly thew my hands up
(maybe too quickly). So I decided to learn PERL just to learn it. I'm curious, what are some
practical uses for PERL (online. but more importantly offline/background/not used by public), does
perl use the same if, else, while and the like as PHP? Thanks...
Need To Install Script - $10
- (5)
I need to install an multilevel affiliate script,the script is based on cgi perl and mysql I have
installed the script but i am facing some errors ,so either you could correct them or reinstall it.
A complete documentation for the install instruction is available in a detailed format. I would pay
10$ (for installing or for correcting the errors) Please pm me if you are interested in this work.
pm only if you are known with cgi perl and all needed to install the script...
Simple Perl Script...
- (1)
I want to know the perl path to include at the beginning of the file....so that my perl scripts will
run properly... Or is it ok to make a cgi-bin directory and put my perl scripts in it? Any reply is
appreciated. cpn...
Using Perl For Newsletter Subscription
- (1)
so I'm interested in adding a newsletter subscription to my website for visitors that are
interested. I configured the cgi script, now I'm only wondering how to use the smtp feature with
astahost.. would 'localhost' suffice, or will I be needing to get smtp auth? thanks for the
help /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />...
Share Your CGI Scripts Here
- (1)
If You Looking CGI Script or you want share information about it please comment here /cool.gif"
style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> Stop using those horrible
colors, fonts and font-sizes. ...
What Is Perl?
- (11)
I have been looking high and low for a good domain service, and most places I have checked have Perl
as a feature (including this one). What is Perl? It is included in the same info space that stuff
like cPanel is put. But most importantly, how can Perl help me? If it can't, why do they
advertise the ability to use it everywhere?...
Best Place For Information On Perl
- I would like to learn Pearl! (8)
Hello, I would like to learn Pearl so that I can start working with CGI scripts so that I can in
order to build a more inventive/interactive and dynamic website. I would like if someone could
point me to a site were I can not only learn Pearl, but also download software to help devlop code.
(An IDE of some type.) Thanks, Tim...
Simple Problem W/ Perl
- I can't get this hello world script (5)
Here's my code: CODE #!/usr/bin/perl # print "Content-type: text/html\n\n"; print "Howdy,
world!"; I saved it in my cgi-bin with 777 permissions and It goes; QUOTE Internal Server
Error The server encountered an internal error or misconfiguration and was unable to complete your
request. Please contact the server administrator, webmaster@supper.astahost.com and inform them of
the time the error occurred, and anything you might have done that may have caused the error. More
information about this error may be available in the server error log. Addition...
Create Easily Modifiable Html Templates For Use In Your Perl Cgis
- (0)
Copied from http://www.tutorialized.com/tutorial/Ace-P...te-Creator/3364 QUOTE Hate having
to place all the print statements in your program and having to escape all those quotes? Would you
like to give the ability for people who don't know how to program in perl to customize the
output of your cgis? Templates are the answer. Here's how it works. Take any html file and
anywhere you place in(variable), it gets replaced with $in{'variable'}. For example, if you
have $in{'name'} = 'bob' and an html file that has: Name: in(name) T...
Perl: Exec Or System ?
- which is best for this senerio (3)
I am writing a script to add submit/add projects to a queue. I don't need a returned result
other than it worked or failed. The script will execute a commandline like thisL 'program -b
$filename -s $start -e $end -a' all I need is for that command to be send and if it suceeds
return a simple "This worked" or "This failed: here is why ___________". I am just trying to
remember the difference between exec and system() for this task. I've read through the
documentation and am still a little confused. It's the first time I've really used P...
Password Reminder And Password Change .htaccess
- I need a script to change password (4)
Hi, I use .htaccess to protect the members area of my site. I use a script called register.pl
(search hotscripts and you'll see it) This script takes the username and password provided by
the user and then enters the username and the encrypted password into the password file. What I
want to do is, along with the username and password being taken, I want to also take the email
address and when the user forgets his/her password all he has to do is type in the email, and the
password will be sent. Thanks in advance, /smile.gif' border='0' style='vertical-align:mid...
Strange Perl Behavior
- (4)
I have been working on a strange problem I've been having. I am reading a series of large files
(50 mb or so) in one at a time with: @lines = ; or (same behavior with each) while( ){
push(@lines, $_); } The first time I read a file it will read into the array in about 2 seconds.
The second time I try to read a file in (the same size) it takes about 20 seconds. Everything is
declared locally inside the loop so, everything is leaving scope. I am not sure why it is taking so
much longer the second time. I need to read the entire file in because I am doi...
Sockets And Perl
- for a chat script (1)
Okay, I was trying to write a chat script for perl with tk for the GUI on active perl 5.8. But
whenever I use the $socket->listen() function to connect to the client, the script always hangs on
me. Any ideas as to how to avoid this problem (I've tried numerous codes including the one from
webmonkey)....
Does Anyone Know To Use Movabletype (perl)
- (6)
I can't fit my long title in the topic title so cont..impeccable knowdledge of Moveabletype 2.xx
it's like so foriegn to me..I'm really new at this but I'm trying to make a blog and
I'm so clueless..any help? thanx in advance...
Perl, the hacker language?
- (6)
For you why many times we associate Perl to the hacker's world?for many exploit write in perl or
for the flexibility of the Lang, what do you think about? For me, Because in perl the operation on
the strings and with the socket are powerful as in c but perl is simpler to write IMHO Byez &
'njoy...
Perl Text Safety
- (1)
How do you make inmput from a textarea html and perl safe?? like remove the / the tabs (\t) and
linebrakes (\n) like the javascript escape command (so i can store it into a textfile that reads
line by line inforation and uses /t as a seporater (I could use someting else as a seporater if that
would make more sence )) Thanks for all your sujestions ...
Crypto Program
- A perl "script" to protect data (0)
If you'd like to protect you doc without the standard program and algorithms you'll fide it
useful, Now the only big problem is the ARRAY pased to the subs, in fact I can't pass 2 @ at
the same Sub so I have to use a global array(@plus) in the subroutines, SomeOne knows if is it
possibile to pass 2 @ to a sub? if yes how? CODE #!/usr/bin/perl #************Random Signature
V1,0******************# #* CodeName: Crypto v1.7 alpha *# #* Coder: K22 -
www.klakice.astahost.com; *# #* Date: 07/11/2004; ...
Looking for perl, script
|
*SIMILAR VIDEOS*
Searching Video's for perl, script
|
advertisement
|
|