× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

insert value in {joodb form}

More
2 years 6 months ago #6314 by clibert
insert value in {joodb form} was created by clibert
Hi,
how to insert value read from MySQL into {joodb form}?

Please Log in to join the conversation.

More
2 years 6 months ago #6318 by Dirk
Replied by Dirk on topic insert value in {joodb form}
As you would do it in the normal single view template. With {joodb field|XXX}

{joodb field|title}
{joodb field|description}




But if you want to read data from another Table you must write a custom plugin.

Like This
Read value from another table and output form field with this value.
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');

if (count($part->parameter)>=1) {
	$db = JFactory::getDbo();
    $field = $db->escape($part->parameter[0]);
	if ($result = $db->setQuery("SELECT `".$field."` FROM #__YOURTABLE WHERE XXX = YYY")->loadResult()) {
		$output .= '<input type="text" name="'.$field.'" value="'.htmlspecialchars(stripcslashes($result), ENT_COMPAT, 'UTF-8').'" />';
	}
}

Please Log in to join the conversation.

More
2 years 6 months ago #6319 by clibert
Replied by clibert on topic insert value in {joodb form}
ok - I insert {joodb form|field_name} and get empty input box.
Should I add something else?

Please Log in to join the conversation.

Moderators: Dirkjoest