mothra: <input type=""> default to text if no/invalid value

front
stanley lieber 2011-10-03 09:39:45 -05:00
parent 001ce57253
commit 88f938cbe7
1 changed files with 2 additions and 6 deletions

View File

@ -169,8 +169,6 @@ void rdform(Hglob *g){
f->name=strdup("no-name");
}
}
else if(cistrcmp(s, "search")==0)
f->type=TYPEIN;
else if(cistrcmp(s, "checkbox")==0)
f->type=CHECK;
else if(cistrcmp(s, "radio")==0)
@ -188,10 +186,8 @@ void rdform(Hglob *g){
f->type=RESET;
else if(cistrcmp(s, "hidden")==0)
f->type=HIDDEN;
else{
htmlerror(g->name, g->lineno, "bad field type %s, ignored", s);
break;
}
else
f->type=TYPEIN;
if((f->type==CHECK || f->type==RADIO) && !pl_hasattr(g->attr, "value")){
free(f->value);
f->value=strdup("on");