1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00

html_input(): improve the test logic and simplify the code.

This commit is contained in:
Laurent MONIN 2005-12-04 12:35:55 +01:00 committed by Laurent MONIN
parent e222bb733c
commit 1223850567

View File

@ -220,14 +220,16 @@ no_type_attr:
if (fc->type != FC_FILE)
fc->default_value = get_attr_val(a, "value",
html_context->options);
if (!fc->default_value && fc->type == FC_CHECKBOX)
if (!fc->default_value) {
if (fc->type == FC_CHECKBOX)
fc->default_value = stracpy("on");
if (!fc->default_value && fc->type == FC_SUBMIT)
else if (fc->type == FC_SUBMIT)
fc->default_value = stracpy("Submit");
if (!fc->default_value && fc->type == FC_RESET)
else if (fc->type == FC_RESET)
fc->default_value = stracpy("Reset");
if (!fc->default_value && fc->type == FC_BUTTON)
else if (fc->type == FC_BUTTON)
fc->default_value = stracpy("Button");
}
if (!fc->default_value)
fc->default_value = stracpy("");