mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -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;
|
return;
|
||||||
|
|
||||||
foreach (fc, form->items) {
|
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));
|
struct js_input *fcobj = js_get_form_control_object(interp, parent_form, fc->type, find_form_state(doc_view, fc));
|
||||||
|
|
||||||
if (fcobj) {
|
if (fcobj) {
|
||||||
|
@ -631,7 +631,7 @@ form_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
|||||||
foreach (fc, form->items) {
|
foreach (fc, form->items) {
|
||||||
JSObject *fcobj = NULL;
|
JSObject *fcobj = NULL;
|
||||||
|
|
||||||
if (!fc->name || strcasecmp(string, fc->name))
|
if ((!fc->id || strcasecmp(string, fc->id)) && (!fc->name || strcasecmp(string, fc->name)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
fcobj = get_form_control_object(ctx, obj, fc->type, find_form_state(doc_view, fc));
|
fcobj = get_form_control_object(ctx, obj, fc->type, find_form_state(doc_view, fc));
|
||||||
|
Loading…
Reference in New Issue
Block a user