Unfortunately,

i find nothing about how to apply the right stylesheets to my form
PerForm (1.4-1.6) xsp's.

In my tests, the resulting <Form></Form> is missing, so the form would
be really submitten, when i press save.

Here ist my source document...

<?xml-stylesheet href="NULL" type="application/x-xsp"?>
<?xml-stylesheet href="stylesheets/perform_html.xsl" type="text/xsl"?>
<xsp:page 
        xmlns:xsp="http://www.apache.org/1999/XSP/Core"; 
        xmlns:param="http://axkit.org/NS/xsp/param/v1"; 
        xmlns:util="http://apache.org/xsp/util/v1"; 
        xmlns:f="http://axkit.org/NS/xsp/perform/v1";
>
<xsp:logic>
  sub validate_firstname
  {
      my ($ctxt, $value) = @_;

      $value =~ s/^\s*//;

      $value =~ s/\s*$//;

      die 'No value' unless $value;

      die 'Invalid firstname - non word character not allowed' if $value
=~ /\W/;
  }
  
  sub validate_lastname
  {
      return validate_firstname(@_);
  }

  sub submit_save
  {
      my ($ctxt) = @_;

      # save values to a database

      warn( sprintf "User: %s %s", $ctxt->{Form}{firstname},
$ctxt->{Form}{lastname} );
  }
</xsp:logic>
  <f:form name="add_user">
      <f:textfield name="firstname" width="30" maxlength="50"/><br/>
      <f:textfield name="lastname" width="30" maxlength="50"/><br/>
      <f:submit name="save" value="Save" goto="users.xsp"/>
      <f:cancel name="cancel" value="Cancel" goto="/axkit/"/>
  </f:form>
</xsp:page>

And here is the result, with the missing <form action=...> tag:

<?xml version="1.0"?>
<input type="hidden" name="__submitting" value="1"/>
<input type="text" name="firstname" value="" size="30" maxlength="50"/>
<input type="text" name="lastname" value="" size="30" maxlength="50"/>
<input type="submit" name="save" value="Save"/>
<input type="submit" name="cancel" value="Cancel"/>

TIA,

Murat Uenalan

Charit�
Rudolf Virchow Hospital
Biomedical Research Center
Berlin / Germany

Mailto: [EMAIL PROTECTED] 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to