Skip to content

error if parameter present #4

Description

@net1957

on my form action i have already a locale=xx parameter.
The code add the ?X-Progress-ID=. But this is only correct for the first parameter.
So I did code a little hack :

      /* patch the form-action tag to include the progress-id if X-Progress-ID has been already added just replace it */

      if(old_id = /X-Progress-ID=([^&]+)/.exec($(this).attr("action"))) {
        var action = $(this).attr("action").replace(old_id[1], uuid);
        $(this).attr("action", action);
      } else {
        if($(this).attr("action").indexOf("?") != -1) {
          $(this).attr("action", jQuery(this).attr("action") + "&X-Progress-ID=" + uuid);
        } else {
          $(this).attr("action", jQuery(this).attr("action") + "?X-Progress-ID=" + uuid);
        }
      }

I'm not a javascript coder so I think it's not the best way, but it work.

Cheers!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions