pub max_length: i32,
pub rows: i32,
pub format: Option<ZakFormElementFormat>,
+ pub placeholder: String,
+ pub class: String,
#[serde(rename = "default-value")]
pub default_value: String,
pub editable: String,
pub to_load: String,
#[serde(rename = "to-save")]
pub to_save: String,
- pub placeholder: String,
#[serde(rename = "option")]
pub options: Vec<ZakFormElementSelectOption>,
None => { },
};
+ if e.placeholder != "" {
+ writeln!(output, "fi.set_placeholder({})", e.placeholder);
+ }
+ if e.class != "" {
+ writeln!(output, "fi.set_class({})", e.class);
+ }
+
for option in e.options {
writeln!(output, r#"fi.add_option(zakform::fields::FOption{{ value: String::from("{}"), label: String::from("{}") }});"#, option.id, option.text);
}