471,049 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,049 software developers and data experts.

Simple script won't work - why?

Simple script won't work. Why?

function sendIt(module) {

var flagged = document.form1.getElementById("e_flagger").value;
if (module == 'test') {
alert("Test OK:" + " " + flagged);
}

<form name="form1" method="post" onSubmit="sendIt('test');"
<input type="text" size="1" name ="flager" value="Flag">
<input type=submit value="Test It">
</form>

HF
Dec 30 '05 #1
2 1395
he***@earthlink.net wrote:
Simple script won't work. Why?

function sendIt(module) {

var flagged = document.form1.getElementById("e_flagger").value;
if (module == 'test') {
alert("Test OK:" + " " + flagged);
}

<form name="form1" method="post" onSubmit="sendIt('test');"
<input type="text" size="1" name ="flager" value="Flag">
<input type=submit value="Test It">
</form>

HF


First, you have no element with ID "e_flagger".

Secondly, I believe that document.form1.getElementById is invalid (the
correct form being document.getElementById)

What are you trying to do?

Andrew Poulos
Dec 30 '05 #2
On 2005-12-30, <he***@earthlink.net> <he***@earthlink.net> wrote:
Simple script won't work. Why?


Id different from Name.

read the FAQ.
Bye.
Jasen
Dec 30 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.