Skip to content

Instantly share code, notes, and snippets.

@mashihua
Created December 2, 2011 22:02
Show Gist options
  • Save mashihua/1425019 to your computer and use it in GitHub Desktop.
Save mashihua/1425019 to your computer and use it in GitHub Desktop.
Enable mobile CMB on desktop Safari
SubmitControl.prototype.submit = function() {
var sXmlReq = "";
if (BSGetElementIgnoreError("TransID_New") != null) {
this.addFieldByElementId("TransID_New");
}
for (var i = 0; i < this.m_fields.length; i++) {
var sName = (this.m_fields[i])[0];
var sValue = (this.m_fields[i])[1];
if ((sName != null) && (sValue != null)) {
sValue = sValue.replace("%", "%25");
sValue = sValue.replace("<", "%3C");
sValue = sValue.replace(">", "%3E");
if (sName == "screenW" || sName == "screenH")
sXmlReq += "<" + sName + ">" + (sName == "screenW" ? "320" : "480") + "</" + sName + ">";
else
sXmlReq += "<" + sName + ">" + sValue + "</" + sName + ">";
}
}
var oForm = BSGetElement(this.m_id);
var oClientNo = BSGetElement("ClientNo");
var oCommand = BSGetElement("Command");
var oXmlReq = BSGetElement("XmlReq");
oForm.action = this.m_action;
oForm.method = this.m_method;
oForm.target = this.m_target;
oCommand.value = this.m_command;
oClientNo.value = this.m_clientno;
oXmlReq.value = sXmlReq;
oForm.submit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment