单击显示下载文件选项

时间:2013-01-03 07:22:50

标签: php

我需要在用户填写下面的download file和名称email时显示form选项 - 这是表格

<form action="process.php" method="post">
    <input type="hidden" name="bot_action" value="form_subscribe" /> <input
        type="hidden" name="bot_track_code" value="1" /> <input type="hidden"
        name="bot_pass_standard" value="0" /> <input type="hidden"
        name="bot_pass_custom" value="0" /> <input type="hidden"
        name="bot_account" value="howtopossibleit" /> <input type="hidden"
        name="bot_redirect" value="" /> <input type="hidden"
        name="bot_web_form_id" value="44640" />
    <table width="230" border="0" cellpadding="0" cellspacing="0">

        <tr>
            <td height="10" width="10%" align="left" valign="middle"></td>
            <td height="10" width="28%" align="left" valign="middle"><div
                    style="font: bold 13px verdana, sans-serif; letter-spacing: -1px; color: #363636; margin: 0px 0px 0px 0px;">
                    <div align="center">Name:</div>
                </div></td>
            <td height="10" width="62%" align="left" valign="middle"><input
                type="text"
                style="width: 85%; margin: 0 auto; font: 10px verdana, sans-serif; height: 12px; line-height: 100%; padding: 2px 1px 1px 1px; border: 1px solid #363636; background: #ffffff url('http://images/form-input-bg.jpg') top left repeat-x;"
                name="fullname" value="" /></td>
        </tr>
        <tr>
            <td height="31" width="10%" align="left" valign="middle"></td>
            <td height="15" width="28%" align="left" valign="middle"><div
                    style="font: bold 13px verdana, sans-serif; letter-spacing: -1px; color: #363636; margin: 0px 5px 0px 0px;">
                    <div align="center">Email:</div>
                </div></td>
            <td height="15" width="62%" align="left" valign="middle"><input
                type="text"
                style="width: 85%; margin: 0 auto; font: 10px verdana, sans-serif; height: 12px; line-height: 100%; padding: 2px 21x 1px 1px; border: 1px solid #363636; background: #ffffff url('http://images/form-input-bg.jpg') top left repeat-x;"
                name="email" value="" /></td>
        </tr>
        <tr>
            <td height="15" colspan="3" align="center" valign="middle"><table
                    style="border: 1px solid #363636;" cellpadding="0" cellspacing="0">
                    <tr style="background-color: #e8e8e8; color: #FFFFFF;">
                        <td width="234" height="26" align="center" bgcolor="#FF0000"
                            style="border-top: 1px solid #ffffff; border-left: 1px solid #ffffff;"><input
                            type="submit"
                            style="overflow: auto !important; overflow: visible; width: auto !important; width: 55px; margin: 0px 15px 0px 15px; border: 0px; background-color: #FF0000; font: bold 13px verdana, sans-serif; letter-spacing: -1px; color: #363636;"
                            name="submit2" value="SUBMIT, Than press Download" /></td>
                    </tr>
                </table></td>
        </tr>
        <tr>
            <td height="4" colspan="3" valign="middle"
                style="padding: 3px 0px 3px 0px;"></td>
        </tr>
    </table>
</form>

以下是download file代码:

DownloadFile: &nbsp;<a href="admin/quality/<?php echo $fetchRows['fld_file']?>"><img width="32" height="32" title="Download File" src="images/downloadfile.png" alt="Download"></a>

1 个答案:

答案 0 :(得分:1)

将代码设置为div并使其显示:none最初..

<div id="link" style="display:none"><a href="admin/quality/<?php echo $fetchRows['fld_file']?>"> <img width="32" height="32" title="Download File" src="images/downloadfile.png" alt="Download"></a></div>

在name&amp;的onblur事件中调用此jquery函数电子邮件字段

function enableLink() {
       if($("#name").val() != "" && $("#email").val() != "") 
                $("#link").show();
       else
                $("#link").hide();
}