Commit b51441d5a8e1bab85040975222b1e7efce71179c

Authored by Cédric RICARD
1 parent 8c9091aa

Adding file_upload field into mf_generic_form

Showing 1 changed file with 8 additions and 4 deletions   Show diff stats
calexium_lib/web/CXM_making_a_web_site.anubis
... ... @@ -988,7 +988,7 @@ public type HTML_In_Form:
988 988 text_input_ro (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int32 width),
989 989 password_input (List(InputAttrs), String label_text, HtmlId id, WebArgName name, InitialValue init, Int32 width),
990 990 text_area (List(TextAreaOption), String name, String init, Int32 width, Int32 height),
991   - file_upload (String name, Int32 width),
  991 + file_upload (String label, HtmlId id, WebArgName name, Int32 width),
992 992 selector (String name, Int32 size, List(String) choices),
993 993 selector (String name, Int32 size, List(String) choices, String selected),
994 994 // List((String,String)) = List((code,name)) where :
... ... @@ -1108,6 +1108,9 @@ public define HTML_In_Form
1108 1108 check_box_r (List(InputAttrs) options, String label_text, WebArgName n, WebArgValue value, Bool checked)
1109 1109 = check_box_r (options, label_text, htmlId(n.name), n, value, checked).
1110 1110  
  1111 +public define HTML_In_Form
  1112 + file_upload (WebArgName name, Int32 width)
  1113 + = file_upload("", htmlId(""), name, width).
1111 1114  
1112 1115  
1113 1116 public type HTML_Off_Form:
... ... @@ -3724,8 +3727,9 @@ define Printable_tree
3724 3727 "<input type=password name=p",name," id=",id," size=",w," value=\"",i,"\"",format_attrs(options),">"],
3725 3728 text_area(opts,n,i,w,h) then
3726 3729 ["<textarea ",format(opts)," name=o",n," cols=",w," rows=",h,">",i,"</textarea>"],
3727   - file_upload(n,w) then
3728   - ["<input type=file size=",w," name=o",n,">"],
  3730 + file_upload(label, id, n, w) then
  3731 + ["<label for=\"",id,"\">",label,"</label>",
  3732 + "<input type=file id=",id," size=",w," name=o",n,">"],
3729 3733 selector(n,s,cs) then
3730 3734 ["<select name=o",n," size=",s,">",format_choices(cs),"</select>"],
3731 3735 selector(n,s,cs,sd) then
... ... @@ -3808,7 +3812,7 @@ define Bool
3808 3812 text_input_ro(o,lt,l,n,i,w) then false,
3809 3813 password_input(o,lt,l,n,i,w) then false,
3810 3814 text_area(o,n,i,w,h) then false,
3811   - file_upload(n,w) then true,
  3815 + file_upload(l,i,n,w) then true,
3812 3816 selector(n,s,c) then false,
3813 3817 selector(n,s,c,p) then false,
3814 3818 selector_c(n,s,c) then false,
... ...