我想将ukaccess函数的返回值组合到setarea函数设置的值中,但我没有足够的经验知道下一步该做什么。希望到目前为止代码是正确的。
function ukaccess(){
var dbasedata = document.forms[0]._dbase_name.value;
dbasedata = dbasedata.toUpperCase();
if (dbasedata.indexOf("UK_CONTACTS")>-1) {
return "UK_CONTACTS";
}
}
function setarea(){
var postcode2 = document.forms[0]._postalcode.value;
var trim_pcode = (postcode2.substr(0,8));
trim_pcode = trim_pcode.toUpperCase();
trim_pcode = trim_pcode.replace(/\s/g, "");
if (trim_pcode == "W1W6UW" || trim_pcode == "W1G8HU") {
//alert("London-Xover");
document.forms[0]._area.value = "North London" [ukaccess function return value here];
答案 0 :(得分:2)
尝试
document.forms[0]._area.value = "North London" + ukaccess();