Hi all,

Not a coder (or a good one at least), and I'm trying to conditionally hide a CCK input field based on a value I put in a URL.

For example, if the URL has future=true appended to the end, I want field XYZ to be presented to the user. If future=false is appended to the end of the URL, I want this field to be hidden.

Currently I have the following in my

ccktype-edit.tpl.php...

<?php
	$future_check = $_GET['future'];
	if ($future_check='yes') {
			print drupal_render($form['field_ds_future_date']);
		}
		else {
			unset($form['field_ds_future_date']);
		}
?>

Am I even on the right track? It makes sense to me, but the if/then statement is clearly is not working.

Thanks for the help!

Comments

flyingL123’s picture

Anyone on this issue so far? I'm looking to do something very similar. if you can't hide the field by pulling a variable from the URL, would it be possible to tell drupal which tpl.php file to pull based on where the page was directed from?

i.e., have multiple tpl.php files for the same cck input form

Thank you!