atul ashpalia <[EMAIL PROTECTED]> wrote:

    Please reply to the list.


: Thanks in advance for your help. please find the
: attached "filltasks.cgi".

    Why attached it? Show it inline. where it is easier
to view.

    You are not using strict and warnings. How did you
learn perl?

use strict;
use warnings;

: use CGI;
: 
: $query = new CGI;

    my $query = new CGI;


: print $query->header;
: 
: print<<"EOF";
: 
: <HTML>
: <HEAD>
: <TITLE>Daily Report</TITLE>
: </HEAD>
: <BODY BGCOLOR="#EEFFFF">

[snipped form]

: <br>
: <a href="filltasks.cgi">New Task</a>
: 
: <br><br><br>
: <input type="submit" value="Submit">
: 
: </center>
: </form>
: 
: </BODY>
: </HTML>
: 
: EOF

    First thing you need to do is name your input fields
and text areas. The name you use for the first fieldset
would probably be numbered and the next ones would increment.


: There's a hyperlink 'New Tasks' above the submit button. On
: click of which i want to add the whole 'Fill Tasks' section
: below the first one.

    You would need some indicator to tell the script that a
new field is being added.

<a href="filltasks.cgi?action=new_task">New Task</a>

    Then in the script you would need to check the 'action'
parameter.

if ( $query->param( 'action' ) eq 'new_task' ) {
    # add fieldset with new names for each input
    # and print larger form

} else {
    # print small form
}

    Your next problem is how to maintain data across page
updates and how to increment field names for each new
fieldset. You might use a link like this.

 <a href="filltasks.cgi?action=task-1">New Task</a>

    And then in the new link use

 <a href="filltasks.cgi?action=task-2">New Task</a>

   To preserve data you could use a submit button instead of
a link. These should submit the form allowing data to be kept
across pages.

 <input type="hidden" name="task-count" value="1">
 <input type="submit" name="new-task" value="Add a new task">


: Then, the same hyperlink should appear below the
: second 'Fill Tasks' section so that i can include the
: third 'Fill Tasks' section below the second one, on
: click of that link. And So on...
: That is, the user may want to include as many tasks he/she want
: to enter. 
: 
: On submit button click, the page is directed to
: 'displaytasks.cgi' wherein i will display the user's data.

    You'd probably do better sending it to the same script
as produced it.

HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328













-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to