Jump to content

php equivalent...


leijae

Recommended Posts

I wrote this code in Javascript... I hate it, but I'm not really well versed in PHP. Is there a PHP equivalent? I'm not asking anyone to do it for me, but if you know of a resource that's good for this matter, please post it.

 

// this is my javascript
function hidey(val)
	{
		if(val == 'on' || val === true)
		{
			document.getElementById('a1').checked = true;
			document.getElementById('toshow').style.display = 'block';
			document.getElementById('tohide').style.display = 'none';
		}
		else if(val == 'off' || val === false)
		{
			document.getElementById('a2').checked = true;
			document.getElementById('toshow').style.display = 'none';
		}

	}

//this is my html
<form action=" " method="post">
						This is on <input id="a1" name="kind" type="radio" value="on" checked="checked" onclick="hidey(this.checked);" /><br />
						This is off <input id="a2" name="kind" type="radio" value="on" checked="checked" onclick="hidey(this.checked);" />

Link to comment
https://forums.phpfreaks.com/topic/241261-php-equivalent/
Share on other sites

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.