anchor.diff:                      document.uploadServiceProvider.submit();
                   }
   
  -                function doCancel() {
  -                    document.getElementById("metadataFromFileSystem").value = "";
  +                function doCancel(caller) {
  +                    if (caller == "metadata") {
  +                        if (document.getElementById("metadataFromFileSystem").value == '') {
  +                            clearAll();
  +                        } else {
  +                            document.getElementById("metadataFromFileSystem").value = "";
  +                        }
  +                    } else {
  +                        if (document.getElementById("metadataFromUrl").value.length == 0) {
  +                            clearAll();
  +                        } else {
  +                            document.getElementById("metadataFromUrl").value = "";
  +                        }
  +                    }
   
                   }
   
  
positive.code:                             <input type="button" value="<fmt:message key='saml.sso.upload'/>" class="button"
                                     onclick="doSubmit();"/>
                              <input class="button" type="reset" value="<fmt:message key='saml.sso.cancel'/>"
                                     onclick="doCancel();"/></td>
                      </tr>
                      </tbody>
                  </table>
  
negative.code:                             <input type="submit" class="button" value="<fmt:message key='saml.sso.upload'/>"
                                     class="button"/ >
                              <input class="button" type="reset" value="<fmt:message key='saml.sso.cancel'/>"
                                     onclick="doCancel('url');"/></td>
                      </tr>
                      </tbody>
                  </table>
  