0
我有一個日期的形式,我想提示用戶,如果他們提交範圍之外的形式,但還是給他們機會的範圍之外提交。軌驗證確認表提交後
例如(僞)
if date < start_date and current_user.admin?
answer = ask 'are you sure you want to submit below the date range?'
elsif date > end_date
answer = ask 'are you sure you want to submit over the date range?'
else
answer = 'yes'
end
if answer == 'yes'
submit
else
return to original form
end
我在想一個解決方案是實現多窗體嚮導類型,但有更簡單的方法嗎?
例如,首先我會顯示帶有日期字段的原始表單。然後,當用戶點擊'提交'按鈕時,如果我們必須要求用戶確認超出日期範圍,請檢查服務器,如果顯示部分並等待他們點擊'確認'或'是'按鈕。
用jQuery做這件事情,並顯示一個jQuery UI對話框會更好嗎? – map7 2012-03-26 22:00:06
取決於你想要什麼,或者你喜歡用什麼編程。我喜歡偏好,因爲它們對我來說更容易風格化。無論如何,如果你有jQuery的經驗 – varatis 2012-03-26 22:10:51