Sponsored Content
Top Forums Shell Programming and Scripting Field verification script help Post 302869115 by Chubler_XL on Tuesday 29th of October 2013 04:16:06 PM
Old 10-29-2013
Not real good with JavaScript, but I'd probably try something like:

Code:
function checkform ( form )
{
       if (form.pass.value.length < 6 || !form.pass.value.match("^\\d{3}") ) {
        alert( "Error." );
        form.pass.focus();
          document.getElementById('pass').style.backgroundColor="#FFFFFF";
        return false ;
      }
<form name="ModifierQuestRepAuthForteForm" method="post" action="servelet.php" onsubmit="return checkform(this);">


Last edited by Chubler_XL; 10-29-2013 at 05:26 PM..
This User Gave Thanks to Chubler_XL For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

verification?

I'm really new at this and wondering how I would go about adding code to my script to verify that all records loaded successfully? (I am loading a file into a table) i'm using the Korn shell. I'm also having trouble verifying parts in the header as i do not really understand the header and... (3 Replies)
Discussion started by: sheranjem
3 Replies

2. UNIX for Dummies Questions & Answers

Verification of a script already running - where to do it

Hi, I have a script I want to run as a background process. Where would I add a bit of script so that a check can be performed to see it this is already running and, where it isn't, to then run it? I know how to do this... I just don't know where I can put the initial part of the check script so... (2 Replies)
Discussion started by: miwinter
2 Replies

3. Shell Programming and Scripting

Email address verification script

Hi Group, Please forgive in case this is discussed. I need help regarding a simple script to verify if the give address exist in the Ldap directory. If the email exists the script should exit with a 0 status or else a non zero status. I am currently using the following script (and it is... (4 Replies)
Discussion started by: Ramdas
4 Replies

4. Programming

htable + verification

hello every body, I have to verifiy if the param_key is selectionned twice or more and to print only one occurence i'm using htable what's the good implementation to add to the code to verify this. code : { char *tmpStr = NULL; ght_iterator_t iterator_param; void... (0 Replies)
Discussion started by: kamel.seg
0 Replies

5. Shell Programming and Scripting

Script for verification of Data corruption

Hi, I am from File system back ground and doing File system testing on Linux, I need script that scirpt that create the different multiple types of .txt, device file and then copy to mount point /mnt/ dir and then verify the created files and copied files, if created files and copied files are... (4 Replies)
Discussion started by: manish_tcs_hp
4 Replies

6. Shell Programming and Scripting

Script Verification

Hi eveyone I am planning to use crontab to delete all files in my donwloads directory that are older than one hour I will be using crontab to run this script find /home/kee/downloads/* -daystart -mmin +59 -type f -name -exec rm -r {}\; could you please let me know if the above... (1 Reply)
Discussion started by: k33k00
1 Replies

7. Shell Programming and Scripting

Verification on shell script

hello i have writing a shell script to download and run some packages the only way that i use to verify download pack is , limit users ip to download from main server, if wget can download file (verified) then script run by execute it sh pack76.sh else show and error (stupid solution ha?) ... (8 Replies)
Discussion started by: nimafire
8 Replies

8. Shell Programming and Scripting

Command/script to match a field and print the next field of each line in a file.

Hello, I have a text file in the below format: Source Destination State Lag Status CQA02W2K12pl:D:\CAQA ... (10 Replies)
Discussion started by: pocodot
10 Replies

9. Programming

ECDSA verification

Using ECDSA, how do you verify integrity of Data (D), Given the value for the following: Random number (r) Signature (s) ECpublic Key (K) Thanks. (0 Replies)
Discussion started by: dragonpoint
0 Replies

10. OS X (Apple)

SHA1 verification script

Hi guys! Me again! ... I'm trying to build (on MacOS directly) a bash script that will help me verify a SHA1 digest (to verify downloads and so on and so forth). So first off, here's my version of BASH under OSX: bash-4.4$ And here's my version of Sierra (macOS): 10.12.3 (16D32) ... (2 Replies)
Discussion started by: Ardzii
2 Replies
CGI::FormBuilder::Template::Text(3pm)			User Contributed Perl Documentation		     CGI::FormBuilder::Template::Text(3pm)

NAME
CGI::FormBuilder::Template::Text - FormBuilder interface to Text::Template SYNOPSIS
my $form = CGI::FormBuilder->new( fields => @fields, template => { type => 'Text', template => 'form.tmpl', variable => 'form', } ); DESCRIPTION
This engine adapts FormBuilder to use "Text::Template". Usage is very similar to Template Toolkit: my $form = CGI::FormBuilder->new( fields => @fields, template => { type => 'Text', # use Text::Template template => 'form.tmpl', } ); The default options passed into "Text::Template->new()" with this calling form are: TYPE => 'FILE' SOURCE => 'form.tmpl' DELIMITERS => ['<%','%>'] As these params are passed for you, your template will look very similar to ones used by Template Toolkit and "HTML::Mason" (the Text::Template default delimiters are "{" and "}", but using alternative delimiters speeds it up by about 25%, and the "<%" and "%>" delimiters are good, familiar-looking alternatives). The following methods are provided (usually only used internally): engine Returns a reference to the "Text::Template" object prepare Returns a hash of all the fields ready to be rendered. render Uses the prepared hash and expands the template, returning a string of HTML. TEMPLATES
<% $jshead %> - JavaScript to stick in <head> <% $title %> - The <title> of the HTML form <% $start %> - Opening <form> tag and internal fields <% $submit %> - The submit button(s) <% $reset %> - The reset button <% $end %> - Closing </form> tag <% $fields %> - List of fields <% $field %> - Hash of fields (for lookup by name) Note that you refer to variables with a preceding "$", just like in Perl. Like Template Toolkit, you can specify a variable to place fields under: my $form = CGI::FormBuilder->new( fields => @fields, template => { type => 'Text', template => 'form.tmpl', variable => 'form' }, ); Unlike Template Toolkit, though, these will not be placed in OO-style, dot-separated vars. Instead, a hash will be created which you then reference: <% $form{jshead} %> <% $form{start} %> etc. And field data is in a hash-of-hashrefs format: For a field named... The field data is in... -------------------- ----------------------- job <% $form{field}{job} %] size <% $form{field}{size} %] email <% $form{field}{email} %] Since "Text::Template" looks so much like Perl, you can access individual elements and create variables like so: <% my $myfield = $form{field}{email}; $myfield->{label}; # text label $myfield->{field}; # field input tag $myfield->{value}; # first value $myfield->{values}; # list of all values $myfield->{options}; # list of all options $myfield->{required}; # required flag $myfield->{invalid}; # invalid flag $myfield->{error}; # error string if invalid %> <% for my $field (@{$form{fields}}) { $OUT .= "<tr> <td>" . $field->{label} . "</td> <td>" . $field->{field} . "</td> <tr>"; } %> In addition, when using the engine option, you supply an existing Text::Template object or a hash of parameters to be passed to "new()". For example, you can ask for different delimiters yourself: my $form = CGI::FormBuilder->new( fields => @fields, template => { type => 'Text', template => 'form.tmpl', variable => 'form', engine => { DELIMITERS => [ '[@--', '--@]' ], }, data => { version => 1.23, author => 'Fred Smith', }, }, ); If you pass a hash of parameters, you can override the "TYPE" and "SOURCE" parameters, as well as any other "Text::Template" options. For example, you can pass in a string template with "TYPE => STRING" instead of loading it from a file. You must specify both "TYPE" and "SOURCE" if doing so. The good news is this is trivial: my $form = CGI::FormBuilder->new( fields => @fields, template => { type => 'Text', variable => 'form', engine => { TYPE => 'STRING', SOURCE => $string, DELIMITERS => [ '[@--', '--@]' ], }, data => { version => 1.23, author => 'Fred Smith', }, }, ); If you get the crazy idea to let users of your application pick the template file (strongly discouraged) and you're getting errors, look at the "Text::Template" documentation for the "UNTAINT" feature. Also, note that "Text::Template"'s "PREPEND => 'use strict;'" option is not recommended due to the dynamic nature for "FormBuilder". If you use it, then you'll have to declare each variable that "FormBuilder" puts into your template with "use vars qw($jshead' ... etc);" If you're really stuck on this, though, a workaround is to say: PREPEND => 'use strict; use vars qw(%form);' and then set the option "variable => 'form'". That way you can have strict Perl without too much hassle, except that your code might be exhausting to look at :-). Things like $form{field}{your_field_name}{field} end up being all over the place, instead of the nicer short forms. Finally, when you use the "data" template option, the keys you specify will be available to the template as regular variables. In the above example, these would be "<% $version %>" and "<% $author %>". And complex datatypes are easy: data => { anArray => [ 1, 2, 3 ], aHash => { orange => 'tangy', chocolate => 'sweet' }, } This becomes the following in your template: <% @anArray; # you can use $myArray[1] etc. %aHash; # you can use $myHash{chocolate} etc. %> For more information, please consult the "Text::Template" documentation. SEE ALSO
CGI::FormBuilder, CGI::FormBuilder::Template, Text::Template REVISION
$Id: Text.pm 100 2007-03-02 18:13:13Z nwiger $ AUTHOR
Copyright (c) Nate Wiger <http://nateware.com>. All Rights Reserved. Text::Template support is due to huge contributions by Jonathan Buhacoff. Thanks man. This module is free software; you may copy this under the terms of the GNU General Public License, or the Artistic License, copies of which should have accompanied your Perl kit. perl v5.14.2 2011-09-16 CGI::FormBuilder::Template::Text(3pm)
All times are GMT -4. The time now is 07:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy