promotion image of download ymail app
Promoted

<HTML語法>填寫表單資料後必須輸入指定密碼才可傳送的語法

各位大大:

小弟有一難題有待解決, 本人利用GOOGLE表單製作了一張表格,可不想每個知道連結的人都可發送表單,主要一段程式碼是這樣子的:

<label class="ss-q-title" for="entry_100">審批人密碼

<span class="ss-required-asterisk">*</span></label>

<label class="ss-q-help" for="entry_100"></label>

<input class="ss-q-short" id="entry_100" name="entry.100.single" type="password" value="" /></div>

</div>

</div>

<br />

<input name="pageNumber" type="hidden" value="0" />

<input name="backupCache" type="hidden" value="" />

<div class="ss-item ss-navigate">

<div class="ss-form-entry">

<input name="submit" type="submit" value="提交" /></div>

</div>

</form>

<script type="text/javascript">

(function() {

var divs = document.getElementById('ss-form').

getElementsByTagName('div');

var numDivs = divs.length;

for (var j = 0; j < numDivs; j++) {

if (divs[j].className == 'errorbox-bad') {

divs[j].lastChild.firstChild.lastChild.focus();

return;

}

}

for (var i = 0; i < numDivs; i++) {

var div = divs[i];

if (div.className == 'ss-form-entry' &&

div.firstChild &&

div.firstChild.className == 'ss-q-title') {

div.lastChild.focus();

return;

}

}

})();

</script></div>

麻煩大大指點一下怎樣才能做到審批人密碼那邊必須輸入正確的密碼才能傳送至後台, 感謝萬分!! (可以的話哪位大大能給我EMAIL,我可以把整個HTML的語法都SD給大大協助我解決~~真的十分感謝~>_<)

Update:

DEAR UNKNOW大大,首先十分感謝你能抽空幫忙, 我剛嘗試過你修改過的語法貼上取代原區域的,可是不能儲存,如果想要用到你提供的修改我想再請問還要在哪些段落需要修改呢.? 如果方便的話,可以給一下你的電郵我嗎..?我想把錯誤的信息及全區域的語法都截圖給你看看,感謝萬分!!!

1 Answer

Rating
  • 7 years ago
    Favorite Answer

    <label class="ss-q-title" for="entry_100">審批人密碼

    <span class="ss-required-asterisk">*</span></label>

    <input class="ss-q-short" id="entry_100" name="entry.100.single.ps" type="password" value="" /></div>

    </div>

    </div>

    <br />

    <div class="ss-item ss-navigate">

    <div class="ss-form-entry">

    <input name="submit" type="button" value="提交" onclick="che_ck()" /></div>

    </div>

    </form>

    <script type="text/javascript">

    function che_ck(){

    if(document.getElementsByName("entry.100.single.ps").value == "[YOUR PASSWORD]" /*把[YOUR PASSWORD] 替換為你的密碼*/) {

    alert("password match");

    document.getElementById('ss-form').submit();

    }else{

    alert("wrong password");

    document.getElementsByName("entry.100.single.ps").value="";

    document.getElementsByName("entry.100.single.ps").focus();

    }

    }

    (function() {

    var divs = document.getElementById('ss-form').

    getElementsByTagName('div');

    var numDivs = divs.length;

    for (var j = 0; j < numDivs; j++) {

    if (divs[j].className == 'errorbox-bad') {

    divs[j].lastChild.firstChild.lastChild.focus();

    return;

    }

    }

    for (var i = 0; i < numDivs; i++) {

    var div = divs[i];

    if (div.className == 'ss-form-entry' &&

    div.firstChild &&

    div.firstChild.className == 'ss-q-title') {

    div.lastChild.focus();

    return;

    }

    }

    })();

    </script></div>

    • Commenter avatarLogin to reply the answers
Still have questions? Get your answers by asking now.