Hi All,

I Need help on php script, I have script which shows select Box/Drop down box.

I need input box instead Select box /Drop down box

I need to enter text (title) in input box instead choosing option from drop down/select box

Help me to replace select box with Input Box

I would like something



		echo "<select name='add' id='add'";

			foreach ($rows as $row)
			{
			echo "<option value='" .$row->url. "' /> ". $row->title;
			}
		echo "</select>";

to be replaced with



			foreach ($rows as $row)
			{
			echo "< input type = 'text' name='add' id =' ". $row->title."';
			}


Please check my script below

Below is complete code


<?php
	defined('_JEXEC') or die ('Direct Access is not allowed');
	$allweblinks = intval($params->get('allweblinks',0));
	$golabel = $params->get('buttonname','Go');
	$blank = intval($params->get('firstblank',0));
	$custom = $params->get('firsttext','');
	$separator = $params->get('separator','');
	$image = $params->get('buttonimage','-1');
	$catname = strtolower($params->get('catname','jumplinks'));
	$autodirect = intval($params->get('autodirect',0));
	if (isset($_POST['submit']) || isset($_POST['submit_x']))
	{
		$link = $_POST['add'];





	$target = $params->get('target','parent');
	switch ($target)
	{

	case 'parent':
		echo "<meta http-equiv='Refresh' content='0;URL=" .$link. "' />";
		break;
	case 'newwith':
		echo "<meta http-equiv='Refresh' content='0;URL=" .$_SERVER["PHP_SELF"]. "' />";
		echo "<script type='text/javascript'>window.open('".$link."');</script>";
		break;
	case 'newwithout':
		echo "<meta http-equiv='Refresh' content='0;URL=" .$_SERVER["PHP_SELF"]. "' />";
		echo "<script type='text/javascript'>window.open('".$link."','',config='toolbar=no');</script>";
		break;


	}
	exit();
}

	$db = JFactory::getDBO();
	$cat = "lower(jc.title) = '".$catname."' AND ";
	if ($allweblinks == '1')
		$cat = '';
	$order = $params->get('order',0);

	switch ($order)
	{
		case 0:
			$orderStr = "ordering";
			break;
		case 1:
			$orderStr = "j.title ASC";
			break;
		case 2:
			$orderStr = "j.title DESC";
	}
	$query = "SELECT j.* FROM #__weblinks j inner join #__categories jc on j.catid = jc.id where $cat  j.published='1' AND jc.published='1' ORDER BY $orderStr";
	$db->setquery($query);
	$rows=$db->loadObjectList();
	error_reporting(E_ERROR); 
	$url = $_SERVER['SERVER_URI'];

	echo "<form action='" . $url . "' method='post' >";



		echo "<select name='add' id='add'";

			foreach ($rows as $row)
			{
			echo "<option value='" .$row->url. "' /> ". $row->title;
			}
		echo "</select>";




		if ($image !=-1 )
		{
			if ($autodirect ==1)
				echo "<input type='submit' ".$style." id='submit' name='submit' value='".$golabel."' />";
			$image = 'images/stories/'.$image;
			echo "<input type='image' " .$style." src='".$image."' id='submit' name='submit' alt='".$golabel."' />";
		}
		else
		{

			echo "<input type='submit' ".$style." id='submit' name='submit' value='".$golabel."' />";
		}


	echo  "</form>";

 ?>





You help, suggestion is highly appreciated ... thanks in advance.

Ramesh chaudhary

    Write a Reply...