Form checking in PSP(Python Server Pages)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dheeraj Joshi
    Recognized Expert Top Contributor
    • Jul 2009
    • 1129

    Form checking in PSP(Python Server Pages)

    Is it possible to check whether the form has some value or not in PSP.

    In PHP we do something like $name=isSet($_P OST['name'])? 1:0

    So is there any equivalent function in PSP?

    Or if not.. How to validate them?
  • YarrOfDoom
    Recognized Expert Top Contributor
    • Aug 2007
    • 1243

    #2
    As far as I know, there are 2 ways of doing this in PSP: psp.apply_data( ) and form, both of which are described on this page.

    Comment

    • Dheeraj Joshi
      Recognized Expert Top Contributor
      • Jul 2009
      • 1129

      #3
      Thanks.. I got it working.

      But I am using something like this...

      something=form['something'];

      and I also tried

      something=form. has_key('someth ing');

      I don't know how it will support both syntax's?

      Any idea?

      Regards,
      Dheeraj

      Comment

      • YarrOfDoom
        Recognized Expert Top Contributor
        • Aug 2007
        • 1243

        #4
        I don't really understand what you're asking in your post.
        Do you want to know if it is possible to to use both syntaxes in the same code?
        Perhaps you could give an example to clarify the situation.

        Comment

        Working...