Jump to content

[SOLVED] Checkbox value with getElementById


treeleaf20

Recommended Posts

All,

I have the following code:

var poststr = "statusupdate=" + encodeURI( document.getElementById("statusupdate").value ) +
                    "&user_name=" + encodeURI( document.getElementById("user_name").value ) +
				"&twitteryes=" + encodeURI ( document.getElementById("twitteryes").checked ) +
				"&currentstatus=" + encodeURI( document.getElementById("currentstatus").value );

 

It seems to be failing on the

"&twitteryes=" + encodeURI (document.getElementById("twitteryes").checked )

 

If I remove it, this part works fine. This is the HTML code:

<input type="checkbox" name="twitteryes" value="yesplease" />

 

Thanks in advance.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.