簡體   English   中英

Adobe表單的Java驗證(單選按鈕)

[英]Javascript validation of Adobe form (radio buttons)

我很難(我是JavaScript新手)在Adobe LiveCycle表單中弄清楚一點驗證。 我有一個第一選擇(4個選項)單選按鈕,第二個選擇(相同的4個選項)和第三個選擇(相同的4個選項),我想進行驗證以確保用戶不會輸入相同的結果3次。

我以為會是這樣的:

event.rc = true;
if (  form1.#subform[0].FirstChoice.rawValue !=   form1.#subform[0].SecondChoice.rawValue ! &&  form1.#subform[0].FirstChoice.rawValue !=  form1.#subform[0].ThirdChoice.rawValue !)
{
    app.alert("You need three separate answers, you dimwit!");
    event.rc = false;
}

顯然,我是個昏昏欲睡的人,這一切都是錯誤的,但是我已經划清了空白。

我也在考慮以下方面:

form1.#subform[0].FirstChoice.rawValue <>   form1.#subform[0].SecondChoice.rawValue ! &&  form1.#subform[0].FirstChoice.rawValue !<>  form1.#subform[0].ThirdChoice.rawValue !)

但我不知道該去哪里。

幫助(請),謝謝。

你很親密 嘗試:

if ((Select1.rawValue != null && Select1.rawValue == Select2.rawValue) || (Select2.rawValue != null && Select2.rawValue == Select3.rawValue) || (Select3.rawValue != null && Select1.rawValue == Select3.rawValue))
{
    app.alert("You need three separate answers, you dimwit!");
}

您需要解決尚未填寫選區的情況。Select1,Select2和Select3是RadioButton組。

我希望將此作為隱藏字段上的計算,因為您希望每當對單選按鈕進行更改時就重新計算。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM