Loading ...
Sorry, an error occurred while loading the content.

Re: XForms istance data validation from javascript

Expand Messages
  • andrey_kukushkin
    Hi, Mark. Thanks for immediate reply. It takes a time for me to look through Google-suggest example. I not quiet anderstand, do you use an extension function
    Message 1 of 3 , Feb 1, 2006
    • 0 Attachment
      Hi, Mark. Thanks for immediate reply. It takes a time for me to look
      through "Google-suggest" example. I not quiet anderstand, do you use
      an extension function in this example to evaluate an inline javascript?

      I think it will work for me, I'll try. And I think that it is
      impossible to make sophisticate web interfaces only with XForms
      without script (yet). So I think "Google-suggest" is a good example of
      using javascript with XForms action and it would be nice to see it in
      the XForms scpecification, and something like that

      "http://groups.yahoo.com/group/formsPlayer/message/2610"

      "<action>
      <message .../>
      <script .../>
      <message .../>
      </action>"

      too.

      Regurds,

      Andrey.


      --- In formsPlayer@yahoogroups.com, "Mark Birbeck" <Mark.Birbeck@x...>
      wrote:
      >
      > Andrey,
      >
      > > I want to submit istance data not with XForms submission operation
      > > but with javascript code:
      > >
      > > [snip]
      > >
      > > I do so because I want to execute some javascript on the result of
      > > the response. But I want to submit data only if the specified
      > > constraint is valid. Is it possible to initiate instance data
      > > validation process (like during XFomrs submission process) from
      > > my javascript code and get the results of this validation.
      >
      > You will just end up recreating submission, but in script! Why not let
      > submission do what it is good at--sending data and checking for
      > validity--and call your JavaScript function after the submission has
      > completed? That way you can also set things up so that it is only
      executed
      > on a successful submission.
      >
      > An example of exactly this is available in an old blog of mine:
      >
      >
      >
      <http://internet-apps.blogspot.com/2005/04/xforms-patterns-incremental-and-g
      > oogle.html>
      >
      > This blog shows 'Google Suggest' suggestions being retrieved into an
      > instance. However, Google sends them as a little XHTML snippet that
      contains
      > a JavaScript array, so we have to parse the data in order to convert
      it to
      > XML, so that we can then use that data in a selection list. This is
      achieved
      > by calling a JavaScript function *after* the data has been returned from
      > Google.
      >
      > Regards,
      >
      > Mark
      >
      >
      >
      >
      > Mark Birbeck
      > CEO
      > x-port.net Ltd.
      >
      > e: Mark.Birbeck@x...
      > t: +44 (0) 20 7689 9232
      > b: http://internet-apps.blogspot.com/
      > w: http://www.formsPlayer.com/
      >
      > Download our XForms processor from
      > http://www.formsPlayer.com/
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.