开发者

JavaScript popup issues

开发者 https://www.devze.com 2023-01-31 06:40 出处:网络
I have an "edit status" link that needs to popup a window开发者_如何学运维. So far, it does not load at all, any ideas why and how it can be fixed?

I have an "edit status" link that needs to popup a window开发者_如何学运维. So far, it does not load at all, any ideas why and how it can be fixed?

--- The .js file

function showEditStatus() {
    document.getElementById( "edit_status" ).style.display = "block";
}

--- The PHP page, the "edit_status" does not popup

<div id="invoice_item">
    <p>
        <strong>Invoice #:</strong> <?=$invoiceData->ID?><br />
        <strong>Receipt #:</strong> <?=$invoiceData->receipt?><br />
        <strong>Date:</strong> <?=$invoiceData->stamp?><br />
        <strong>Comments:</strong> <?=$invoiceData->comments?><br />
        <strong>Status:</strong> <?=ucfirst( $invoiceData->status );?>
        (<a href="#" onclick="showEditStatus(); return false;">edit status</a>)
        
        <div id="edit_status">
            <form method="post" action="edit_status.php">
                <input type="hidden" name="id" value="<?=$invoiceID?>">
                
                <table cellpadding="0" cellspacing="0" border="0" id="status_table">
                    <tr>
                        <td><strong>New Status:</strong></td>
                        <td>
                            <select name="status">
                                <?php
                                    echo "<option value='received'";
                                    if( $invoiceData->status == "received" ) 
                                        echo " selected";
                                    echo ">Received</option>";
                                    
                                    echo "<option value='filled'";
                                    if( $invoiceData->status == "filled" ) 
                                        echo " selected";
                                    echo ">Filled</option>";
                                    
                                    echo "<option value='backordered'";
                                    if( $invoiceData->status == "backordered" ) 
                                        echo " selected";
                                    echo ">Back-ordered</option>";
                                    
                                    echo "<option value='shipped'";
                                    if( $invoiceData->status == "shipped" ) 
                                        echo " selected";
                                    echo ">Shipped</option>";
                                        
                                    echo "<option value='cancelled'";
                                    if( $invoiceData->status == "cancelled" ) 
                                        echo " selected";
                                    echo ">Cancelled</option>";
                                ?>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td><strong>Invoice Comments:</strong></td>
                        <td><textarea name="memo"><?=$invoiceData->memo?></textarea></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><input type="submit" value="Save"></td>
                    </tr>
                </table>
            </form>
        </div>


Made a modification in the CSS by removing: display: none;
At least now it's constantly showing on the page.

Thanks for the tip Pointy!

0

精彩评论

暂无评论...
验证码 换一张
取 消