ข้ามไปเนื้อหา

ผลต่างระหว่างรุ่นของ "CuneiForm"

เพิ่มขึ้น 860 ไบต์ ,  15 เมษายน 2567
บรรทัดที่ 662: บรรทัดที่ 662:


==== Setting Up a Field Proxy ====
==== Setting Up a Field Proxy ====
{{code|link_proxy}}
There is quite a few (but repeated) steps in setting up a proxy element for a field. Hence, CuneiForm comes with a ready-to-use {{code|link_proxy}} function.
 
'''{{code|lang=javascript|1= link_proxy(form_name, fname, proxy_ele, proxy_func)}}'''
 
{| style="margin-left:20px;"
|- style="vertical-align:top;"
| style="width:120px;" | '''Parameters''' ||
* '''form_name''' ''(str)'': The '''id''' attribute of the {{code|form_obj}}.
* '''fname''' ''(str)'': The field name to be bound to the proxy.
* '''proxy_ele''' ''(HTML element)'': The proxy element.
* '''proxy_func''' ''(JavaScript function)'': The function to run when the form is triggered (a usual routine on a [[Multi-component Page]]). This function should accept ''1 boolean argument and returns nothing''.
|}
 
This function takes care of the proxy linking and relaying some key events on it back to the real form field.


=== Form Submission ===
=== Form Submission ===


{{The Tenko Shrine}}
{{The Tenko Shrine}}