[Catalyst] Multiple Submit Button

gaurav001 gmpatel001 at yahoo.com
Thu May 8 19:14:29 BST 2008


Hello Gurus,
So far I learnt Catalyst + FormBuilder + TT2 all by myself...
When I realize use of *.fb file....Its so amazing

Ok coming to the point...I have web page which contain 2 Submit Button....
I use overview.fb file like this

submit: Enroll, Curriculum

When I press Enroll  Button...it should call 1 JavaScript function
and For Curriculum Button ... there is another Javascript function !!!!!!!!

So I defined overview.tt2 file like this
======================================
[% META title = "Overview" %]
<script language="JavaScript">
<!--
function curriculumpage(form)
  {

        window.location='curriculum';
}
function paymentpage(form)
  {
        window.location='payment';
}
//-->
</script>


[% FOREACH field IN formbuilder.submit %]
<center>
        <div id="submit" onClick="paymentpage(this.form)">[% field %]</div>
&nbsp; <br> <br>
        <div id="submit1" onClick="curriculumpage(this.form)"></div>
</center>[% END %]

=============================================

I got both buttons on page...but [% field %] prints both buttons at same
time..so doesn't matter i press "Enroll" or "Curriculum"....Both redirects
to same page...
So i Need VALUE of Submit Button....something like this .........

[% formbuilder.submit.value %]

or I have to define overview.fb file like this.
fields: 
      enroll:
                value: Enroll
                type: button

      curriculum:
                value: Curriculum
                type: button


Any IDEA..How can I get value of both buttons so i can redirect to different
page ????????????????
Thanks in Advance



-- 
View this message in context: http://www.nabble.com/Multiple-Submit-Button-tp17130149p17130149.html
Sent from the Catalyst Web Framework mailing list archive at Nabble.com.




More information about the Catalyst mailing list