Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-07-2004, 04:03 PM   PM User | #1
Oompi
New to the CF scene

 
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Oompi is an unknown quantity at this point
Question checkbox with innerHTML

Hi!

I made this script but always that submit is done all checkbox in the page are erased. My question is, how make submit, without that checkbox are erased from the page ?

JS script:
----------

<script language="JavaScript" type="text/javascript">
<!--
function checkForm()
{
if (document.addcheck.info.value == "") {
document.addcheck.info.focus();
return false;
} else {
elem = document.getElementById('checkID');
elem.innerHTML = elem.innerHTML + "<input type='checkbox' name'check[]' value='+ document.addcheck.info.value +'>" + document.addcheck.info.value + "<br>";
return true;
}
}
//-->
</script>

PHP file:
----------

...

<?
echo "
<form method=\"post\" action=\"addcheck.php\" name=\"addcheck\">
<input type=\"text\" name=\"info\">
<input type=\"submit\" name=\"anexar\" value=\"Anexar\" onClick=\"checkForm();\"><br><br>
<div id=\"checkID\"></div>
</form>";
?>

...

Tks for the help!

Last edited by Oompi; 07-08-2004 at 02:49 AM..
Oompi is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:45 PM.


Advertisement
Log in to turn off these ads.