// base library is Prototype.js // alert(Prototype.Version); function callback(resp) { var res = resp.responseText.evalJSON(); if (res[0]) { submit(res[1]); } else { $('ErrMsgArea').update(res[1]); location.href = '#ErrMsgArea'; } }; function validate() { var param = $('InqInfo').serialize(); var aj = new Ajax.Request( 'validate_form', { method: 'post', parameters: param, onComplete: callback }); }; function submit(hmac_val) { var f = $('InqInfo'); var inp = $('hmac'); inp.value = hmac_val; f.submit(); };