/    Sign up×
Community /Pin to ProfileBookmark

hi,

i run a javascript code but i cannot submit a form.

from php file :

[CODE]<form name=”delusr” id=”delusr” method=”post” action=”deluser.php”>
<? echo ‘<input type=”hidden” name=”useridval” id=”useridval” value=”‘.$p_userid.'” />’; ?>
</form>
<div class=”meta”>
<p style=”font-size:9px” onclick=”removeuser()”>Verwijderen</p>
</div>[/CODE]

from javascript file :

[CODE]function removeuser(){
//var idval = document.getElementById(“useridval”).value;
//alert(idval);
document.delusr.submit();
}[/CODE]

what im doing wrong?

i get error “Why do I get ‘Object doesn’t support this property or method”

please advice

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@FangMar 04.2010 — document.getElementById('delusr').submit(); // the [I]id[/I]
document.delusr.submit(); // the [I]name [/I]which you are not using
Copy linkTweet thisAlerts:
@keydemberauthorMar 04.2010 — many thanks.

a working solution ?

but strange that my line was not working because i got more javascript submits with using "document.<id>.submit()

anyway, your solution works for me

thanks

keydember
Copy linkTweet thisAlerts:
@KorMar 05.2010 — ...i got more javascript submits with using "document.<id>.submit()
[/QUOTE]

That happens only in IE and only if the element has no [B]name[/B]. [B]name[/B] and [B]id[/B] are different attributes. IE, incorrectly, is able to take and [B]id[/B] instead of a [B]name[/B], if the [B]name[/B] is missing.
×

Success!

Help @keydember spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...