1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-30 03:26:23 -04:00

Ecmascript: more id checks

This commit is contained in:
Witold Filipczyk 2006-05-01 19:55:43 +02:00 committed by Witold Filipczyk
parent 8761bf04a9
commit c540a9ed63
2 changed files with 2 additions and 2 deletions

View File

@ -566,7 +566,7 @@ js_form_elems_namedItem(struct SEE_interpreter *interp, struct SEE_object *self,
return;
foreach (fc, form->items) {
if (fc->name && !strcasecmp(string, fc->name)) {
if ((fc->id && !strcasecmp(string, fc->id)) || (fc->name && !strcasecmp(string, fc->name))) {
struct js_input *fcobj = js_get_form_control_object(interp, parent_form, fc->type, find_form_state(doc_view, fc));
if (fcobj) {

View File

@ -631,7 +631,7 @@ form_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
foreach (fc, form->items) {
JSObject *fcobj = NULL;
if (!fc->name || strcasecmp(string, fc->name))
if ((!fc->id || strcasecmp(string, fc->id)) && (!fc->name || strcasecmp(string, fc->name)))
continue;
fcobj = get_form_control_object(ctx, obj, fc->type, find_form_state(doc_view, fc));