mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Ecmascript: more id checks
This commit is contained in:
parent
8761bf04a9
commit
c540a9ed63
@ -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) {
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user