Page 1 of 1

How do I autofill a field using get(Joomla/JCook Component)?

Posted: Fri Jun 19, 2015 8:25 pm
by jonathanbell
Being really new to PHP and also "old :(" I am struggling to understand how I update a field from a url: Forgive me I have given it a good try. I tried to update the following code with the <?php echo $_GET["entered"] but it doesn't work. - The field is a date field. I have already worked out how to add the ?entered=(result from other page) into the URL. And have seen how it can fill a field from the following example..

Code: Select all

<input autocomplete='off' class='loginInput' tabindex='3' type="text" name="company" id="incident" value="<?php echo $_GET["entered"]; ?>
I just don't know how to get it to work in the code below... I just updated the php echo with the value "worth a crack when u dont know what the result will be" What am I missing??

Code: Select all

<?php
	// incident
	$field = $fieldSet['jform_incident'];
	?>
	<div class="control-group <?php echo 'field-' . $field->id . $field->responsive; ?>">
		<div class="control-label">
			<?php echo $field->label; ?>
		</div>
	
	    <div class="controls">
			<?php echo $field->input autocomplete='off' value="<?php echo $_GET["entered"]; ?>"; ?>
		</div>
	</div>
This is off a view page in a component created in J-Cook for Joomla...

Thanks in advance if someone is kind enough to show me what I have done wrong.