Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Problems with a button in PHP Code

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Problems with a button in PHP Code

Postby asanrod » Wed Jul 03, 2013 11:23 am

I have the following button
<td><input type="button" name="clear" value="clear" onClick="clearAllRadios()" /></td>

And the script embedded in <head> </head>

<script language="JavaScript" type="text/javascript">
function clearAllRadios( name ) {
alert( "clearAllRadios );
var radList = document.getElementsByName(name);
for (var i = 0; i < radList.length; i++) {
if(radList[i].checked) document.getElementById(radList[i].id).checked = false;
}
}
</script>

Id doesn't responde to the click button, please help me with some indication.
asanrod
New php-forum User
New php-forum User
 
Posts: 1
Joined: Wed Jul 03, 2013 11:19 am

Re: Problems with a button in PHP Code

Postby johnj » Tue Jul 09, 2013 12:04 am

your function is expecting a parameter. so change onClick="clearAllRadios() to onClick="clearAllRadios('Hello')
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.