채팅 창을 만드는 외부 ASP 파일에 몇 가지 변수를 제출하는 html 양식을 작성하려고합니다.외부 asp 스크립트에 HTML 양식 제출
나에게 제공되는 예제는 http://na.ntrsupport.com/nv/WebIntegration/Connectwise/contactform.aspx?account=41403&lang=us&banner=0&button=connect이지만 두 단계 프로세스가 필요합니다.
제공된 예에서 고객은 입력란을 채우고 "제출"을 클릭 한 다음 별도의 페이지로 이동하여 동적으로 생성 된 자바 스크립트 링크를 클릭하여 채팅 창을 시작합니다.
내가 대신 한 페이지에이로 할 싶지만 일반적인 입력 한 위의 코드에서 외부 스크립트
<script language='JavaScript' src='https://na.ntrsupport.com/nv/inquiero/web/an/ann4.asp?login=41403&lang=us&button=connect&cat=&cob=&oper=&skin=&urloffline=&urlbusy=&sur=&surpre=&bgcolor=&txtcolor=&ref2=/o1https://na.ntrsupport.com/nv/Webintegration/Connectwise/entrypoint.asp?p=1;email%40address.com;Description;Customers+Name;Company+Name&ref=Customers+Name&clientid=Company+Name'> </script>
올바르게 내 HTML 양식에서 변수를 전달하는 방법을 찾는 데 문제가 있어요 "Company Name"및 "[email protected]"과 같은 필드에 텍스트를 입력하여 예제 링크를 얻으십시오.
여러 가지 방법을 시도해 보았지만 양식에서 변수로 url을 보내려는 javascript를 직접 사용하거나 HTML 양식의 동작 부분에서 url을 사용하는 등 원하는 결과를 얻지 못했습니다.
na.ntrsupport.com의 스크립트가 작동하는 방식이나 요청을받는 방식에 대한 제어권이 없으므로이 스크립트를 끝까지 가져와야합니다.
중요한 도움이되지 않을 경우 도움을 주시면 감사하겠습니다.
내 코드 지금까지
<!DOCTYPE html>
<html>
<head>
<title>Chat</title>
<script>
function launchChat()
{
var name = document.getElementById('name').value;
var company = document.getElementById('company').value;
var email = document.getElementById('email').value;
var description = document.getElementById('description').value;
var url = "https://na.ntrsupport.com/nv/inquiero/web/an/ann4.asp?login=41403&lang=us&button=connect&cat=&cob=&oper=&skin=&urloffline=&urlbusy=&sur=&surpre=&bgcolor=&txtcolor=&ref2=/o1https://na.ntrsupport.com/nv/Webintegration/Connectwise/entrypoint.asp?p=1;" + email + ";" + description + ";" + name + ";" + company + "&ref=" + name + "&clientid=" + company;
window.location(url);
return false;
}
</script>
<style>
div{
width:400px;
height:200px;
position:absolute;
left:50%;
top:50%;
margin-left:-100px; /* Negative half the width*/
margin-top:-100px; /* Negative half the height */
}
</style>
</head>
<body>
<div>
<form onsubmit="return launchChat();">
<table>
<tr>
<td colspan=2>
Put Banner here
</td>
</tr>
<tr>
<td>
Name:
</td>
<td>
<input type="text" id=="name" name="name" required>
</td>
</tr>
<tr>
<td>
Company:
</td>
<td>
<input type="text" id="company" name="company" required>
</td>
</tr>
<tr>
<td>
Email:
</td>
<td>
<input type="email" id=name="email" name="email" required>
</td>
</tr>
<tr>
<td>
Description:
</td>
<td>
<input type="text" id="description" name="description" required>
</td>
</tr>
<tr>
<td colspan=2>
<input type="submit" id="submit" name="submit" value="Start Chatting"/>
</td>
</tr>
</table>
</form>
</div>
</html>
당신은 같은 URL을 구축하는 데 문제가 있습니까? – Shomz
javascript를 사용하여 URL을 만들고 필드에서 변수를 가져올 수는 있지만 내장 URL을 사용하여 외부 스크립트를 호출하려면 어떻게해야합니까? – Beuy
나는 무엇이 잘못되었는지를 99 % 확신하지만, 답을주기 전에 양식과 관련된 코드를 보여 주시겠습니까? – Shomz