|
|
|
สอบถามคะ ถ้าจะกำหนด javascript เปิดหน้าใหม่(New Tab) จะต้องกำหนดอย่างไรคะ |
|
|
|
|
|
|
|
สอบถามคะ ถ้าจะกำหนด javascript เปิดหน้าใหม่(New Tab) จะต้องกำหนดอย่างไรคะ
เป็นแบบนี้อะคะ
Code
<img onclick="javascript:flightSearch(document.forms['searchAdvanceForm'])" style="border:0px none; cursor: pointer;" src="images/web/search.png" />
javascript:flightSearch
Code (Java)
function flightSearch(p_form){
var full_month_de = p_form.departMonth.value.split('/');
var year_de = full_month_de[1];
var month_de = full_month_de[0];
var full_month_re = p_form.returnMonth.value.split('/');
var year_re = full_month_re[1];
var month_re = full_month_re[0];
var p_departDate = p_form.departDay.value+'/'+month_de+'/'+year_de;
var p_returnDate = p_form.returnDay.value+'/'+month_re+'/'+year_re;
var p_roundTrip;
for (var i=0; i < p_form.roundTrip.length; i++){
if (p_form.roundTrip[i].checked){
p_roundTrip = p_form.roundTrip[i].value;
}
}
// var record = {
// roundTrip : p_roundTrip,
// routeFrom : p_form.routeFrom.value,
// routeTo : p_form.routeTo.value,
// departDate : p_departDate,
// returnDate : p_returnDate,
// guest : p_form.guest.value,
// child : p_form.child.value,
// infant : p_form.infant.value
// };
// window.open("http://192.168.2.31/ebooking/index.php?c=ebooking&search={roundTrip:'"+p_roundTrip+"',routeFrom:'"+p_form.routeFrom.value+"',routeTo:'"+p_form.routeTo.value+"',departDate:'"+p_departDate+"',returnDate:'"+p_returnDate+"',guest:"+p_form.guest.value+",child:"+p_form.child.value+",infant:"+p_form.infant.value+"}");
window.location.href = "http://"+window.location.host+"/ebooking/index.php?c=ebooking&search={roundTrip:'"+p_roundTrip+"',routeFrom:'"+p_form.routeFrom.value+"',routeTo:'"+p_form.routeTo.value+"',departDate:'"+p_departDate+"',returnDate:'"+p_returnDate+"',guest:"+p_form.guest.value+",child:"+p_form.child.value+",infant:"+p_form.infant.value+"}";
return false;
}
จะต้องกำหนดอย่างไรคะ แนะนำด้วยคะ
Tag : PHP, HTML/CSS, JavaScript
|
|
|
|
|
|
Date :
2013-04-02 11:44:08 |
By :
Baitong_ch |
View :
1924 |
Reply :
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองใช้ window.open(); แล้วไม่ได้หรือครับ
|
|
|
|
|
Date :
2013-04-02 11:57:35 |
By :
Manussawin |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองเปลี่ยนเป็น window.open(); ก็ไม่ได้คะ
|
|
|
|
|
Date :
2013-04-02 13:35:36 |
By :
Baitong_ch |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.open(link,'_blank');
|
|
|
|
|
Date :
2013-04-02 13:47:25 |
By :
Ex-[S]i[L]e[N]t |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Good Jobs
|
|
|
|
|
Date :
2013-04-02 16:46:14 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|