第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

同時從多個選擇中獲取和存儲值

同時從多個選擇中獲取和存儲值

慕田峪4524236 2021-09-30 15:22:45
我得到了 7 select,我需要讀取它們的值以便稍后使用它,但是我只能讀取第一個選擇的值,如果我嘗試讀取第二個或多個,它會崩潰。我需要能夠識別哪個selects'值""與讀取它不同,但如果該值等于"",則忽略它。這是我的腳本:$(document).ready(function() {  $("#MENU").change(function() {    $(this).find("option:selected").each(function() {      var optionValue = $(this).attr("value");      if (optionValue) {        $(".box").not("." + optionValue).hide();        $("." + optionValue).show();      } else {        $(".box").hide();      }    });  }).change();});function myFuction() {  //Getting Value  //var selValue = document.getElementById("singleSelectDD").value;  var selObj = document.getElementById("MENU");  var selValue = selObj.options[selObj.selectedIndex].value;  //Setting Value  document.getElementById("valorsel").value = selValue;}function ELEMENTO() {  //Getting Value  //var selValue = document.getElementById("singleSelectDD").value;  var modifica1 = document.getElementById("AREA");  var modifica2 = document.getElementById("BANCO");  var modifica3 = document.getElementById("USOCFDI");  var modifica4 = document.getElementById("DEPARTAMENTO");  var modifica5 = document.getElementById("EMPRESA");  var modifica6 = document.getElementById("GIRO");  var modifica7 = document.getElementById("NEGOCIO");  var modval1 = modifica1.options[modifica1.selectedIndex].value;  var modval2 = modifica2.option[modifica2.selectedIndex].value;  var modval3 = modifica3.option[modifica3.selectedIndex].value;  var modval4 = modifica4.option[modifica4.selectedIndex].value;  var modval5 = modifica5.option[modifica5.selectedIndex].value;  var modval6 = modifica6.option[modifica6.selectedIndex].value;  var modval7 = modifica7.option[modifica7.selectedIndex].value;}});
查看完整描述

2 回答

?
繁花如伊

TA貢獻(xiàn)2012條經(jīng)驗 獲得超12個贊

您可以使用 if 語句來查看它是否為空。請參閱下面的示例:


function ELEMENTO(){

       var modifica1 = document.getElementById("BANCO");

       var modval1= modifica1.options[modifica1.selectedIndex].value;

       var val = modval1.trim();

       if(val){

            document.getElementById("modfinal").value = modval1;

       }

}

希望這可以幫助!



查看完整回答
反對 回復(fù) 2021-09-30
  • 2 回答
  • 0 關(guān)注
  • 177 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號