HTML 파일의 입력 양식에서 사용자는 URL을 입력해야합니다 (thislink
이라고합시다). 그런 다음 사용자가 제출 버튼을 클릭하면 URL에 thislink
이 통합 된 새 창을 열려고합니다. URL은 '/selection/yes/?value='+thislink'
이어야합니다.입력 양식의 데이터를 사용하여 새 창 열기
여기에 코드의 2 tentatives 있습니다
1 차 시험 :
<form id="urlarticle">
<input type='text' name='thislink'>
<input type='submit' value='Select' onclick = function() {window.open('/selection/yes/?value='+thislink)};>
</form>
2 차 시험 :
<form id="urlarticle">
<input type='text' name='thislink'>
<input type='submit' value='Select'>
</form>
<script type='application/javascript'>
$("#urlarticle").submit(function() {
window.open('/selection/yes/?value='+thislink);
});
</script>
그러나 모두 tentatives가 작동하지 않는, 어떤 도움이 올바른 방법으로를 얻을 수 그것을 써주세요! 당신이 jQuery를 태그하기 때문에
문제는 무엇인가에 그 값을 추가? – Mehmet
입력 값 – epascarello
(1) 대신에'name' 대신'id'를 사용하십시오. (2)'$ ("# thislink"). val();' – Abhitalks