使用href链接填充文本框

时间:2015-12-06 13:40:27

标签: php html forms

我正在尝试使用已经点击的名称填充文本框,我得到了它的工作,但由于某种原因,整个页面将丢失它的整个布局。所有其他包含的文件最终样式表由于某种原因被排除在外。

导致问题的部分代码,(exchange.php):

$selectednaam = '';

if (isset($_GET['q']))
{                                   
    $selectednaam = $_GET['q'];
}

if ($selectednaam != '')
{                                   
    echo("<tr>
        <td>
            <form method='post'><input type='text' name='otheruser' value='$selectednaam' $disabled/>
        </td>
        <td>
            <input type='text' name='amount' value='$amount' $disabled />
        </td>
        <td>
            <input type='submit' name='exchange' value='Exchange' />
        </td>
    </tr>");
}
else
{
    echo("<tr>
        <td>
            <form method='post'><input type='text' name='otheruser' value='$name' $disabled />
        </td>
        <td>
            <input type='text' name='amount' value='$amount' $disabled />
        </td>
        <td>
            <input type='submit' name='exchange' value='Exchange' />
        </td>
    </tr>");
}

if(isset($_POST['list']))
{
    while($fetchusers = mysql_fetch_array($findusers))
    {
        $otherusers = $fetchusers['user'];
        echo("<tr><td><a href='exchange.php?q=$otherusers'>$otherusers</a></td></tr>");
    }
}

有没有快速的方法来填充文本框而不会丢失整个页面样式?

0 个答案:

没有答案