버튼을 클릭하면 Chrome에서 javascript 기능 (InsertRecord())이 실행되지 않지만 IE에서는 정상적으로 작동합니다.버튼 클릭으로 Chrome에서 javascript 기능이 실행되지 않지만 IE에서 정상적으로 작동합니다.
<input id="submit" type="button" value="Request Access" onclick="InsertRecord()" style="width:160px;"/>
function InsertRecord()
{
var txtUserName = document.getElementById('txtUserName').value;
var txtDept = document.getElementById('ddlDept').value;
var txtClass = document.getElementById('txtClass').value;
var txtRole = document.getElementById('ddlRole').value;
var txtAccess = document.getElementById('ddlAccess').value;
if (txtUserName.length != 0 || txtDept.length != 0 || txtClass.length !=0 || txtRole.length !=0 || txtAccess.length !=0)
{
var connection = new ActiveXObject("ADODB.Connection");
var connectionstring = "Data Source=dvuksdcwsql001;Initial Catalog=RP_5500_AppDB;Persist Security Info=True;User ID=CPT_DEV;Password=Cpt%[email protected];Provider=SQLOLEDB";
connection.Open(connectionstring);
var rs = new ActiveXObject("ADODB.Recordset");
rs.Open("insert into Range_Plan_Access values('" + txtUserName + "','" + txtDept + "','" + txtClass + "','" + txtRole + "','" + txtAccess + "')", connection);
alert("Access Requested Successfully!");
connection.close();
}
else
{
alert("Please enter a value for User Name \n Department \n Class \n Role \n Access Required!");
}
}
여기에서 문제를 알려 주시겠습니까?
감사합니다.
안녕하세요. Chrome에서 어떻게 작동되는지 알려주세요. – Emraan
업데이트 된 답변을 확인하십시오. 기존 코드를 변경하지 않고 문제를 해결할 수있는 방법을 찾았습니다. –
도움이되는 답변을 찾은 경우 해당 질문을 업보트하고 문제를 해결하는 데 도움이되는 답변을 수락하십시오! –