5 Replies Latest reply: Apr 24, 2012 3:08 AM by Carl Wilson RSS

    How to encode data being passed to a field in a URL?

    ADITYA NameToUpdate

      The problem is related to the following text from the BMC Midtier manual:

       

      You can pass  values to fields in forms by including the field ID in the URL, as  follows:

       

      http://<mid_tier_server>/<ontextpath>/forms/<ar_server>/<form_name>?F<Field_id>=value.

       

      In the following example, a value of web user is passed to the creator field (field_id=2) of the user form stored on the AR system server mars, from the mid tier server saturn. The default context path is arsys.

       

      http://saturnhttp://saturn/arsys/forms/mars/user?F2-=web%20user

       

      values with space or special characters must be properly encoded. In this example, the space between "Web" and "User" is encoded with %20 .

       

      I am trying to do exactly this. I want to encode values being passed to fields in forms. I know I need to use ar_url_encoder.jsp to do it. The question is how?

      How do I encode data being passed to fields in forms.

      My form is :

      http://x.x.x.x/arsys/servlet/LoginServlet?server=x.x.x.x&username=css&goto=/arsys/forms/x.x.x.x/CSSRemedy_SD%3Fmode%3DSUBMIT%26F<Field_id>%3D$Incident Number$%26F<Field_id>%3D$Assigned Group$%26F<Field_id>%3D$Urgency$%26F<Field_id>%3D$Description$%26F<Field_id>%3D$Submit Date$%26F<Field_id>%3D$Closed Date$

       

      It breaks whenever one of the data passed for a field like $Description$ contains space. I know the solution is to encode it but how do I do it? Should it be encoded before being passed into the field.

       

      Any help would be greatly appreciated!!!