0

レコードの詳細情報リンクをクリックすると、そのレコードの新しいウィンドウが開き、追加情報が表示される検索フォームがあり<a href=more_info.php?id=$rows[id]>、ID を次のページに渡すために使用します。

その次のページには、これを使用して小さなブラウザー ウィンドウをポップアップするボタンがあり、<a href="#" onclick="window.open('signature_pad.html', 'newwindow', 'width=500, height=200'); return false;">このウィンドウには署名パッドがポップアップ表示されます。

私がする必要があるのは、そのレコード ID を 2 番目のウィンドウからポップアップ ウィンドウに渡して、顧客が署名パッドに署名すると、その署名が正しいレコードに投稿されるようにすることです。

2ページ目とポップアップページのコードは次のとおりです(2ページ目のボタンセクションのコードはかなり長く、ボタン部分のみがこの質問に関連するため、スペースを節約するために2ページ目のボタンセクションのコードのみを投稿しました)

<table class="auto-style16" style="width: 615px; height: 28px;">
<td style="width: 435px; height: 22px;" class="auto-style7">
**<a href="#" onclick="window.open('signature_pad.php', 'newwindow', 'width=500,   height=200');    return false;"><input type="button" value="Get Signature" /></a>**

  

そしてポップアップウィンドウ

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Signature Pad</title>

<!-- The Signature Pad -->
<script type ="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript"  src="signature-pad.js"></script>
</head>
<body>
<center>
<fieldset style="width: 435px">
    <br/>
    <br/>
    <div id="signaturePad" style="border: 1px solid #ccc; height: 55px; width: 400px;"></div>
    <br/><br/><br/>
    <button id="clearSig" type="button">Clear Signature</button>&nbsp;
    <button id="saveSig" type="button">Save Signature</button>
    <div id="imgData"></div>
    <br/>
    </fieldset>
</center>
<div id="debug"></div>
</body>
</html>
4

2 に答える 2

1

これはあなたが持っている動作しないページです:

more_info.php

<p>I have some text here and am just a HTML page saved as .php</p>
<table class="auto-style16" style="width: 615px; height: 28px;">
<td style="width: 435px; height: 22px;" class="auto-style7">
**<a href="#" onclick="window.open('signature_pad.php?id=$rows[id]', 'newwindow', 'width=500,   height=200');    return false;"><input type="button" value="Get Signature" /></a>**

これは、次のようになります。

more_info.php

<?php
$myId = $_GET['id'];
?>
<p>I have some text here and am a HTML with PHP page saved as .php</p>
<table class="auto-style16" style="width: 615px; height: 28px;">
<td style="width: 435px; height: 22px;" class="auto-style7">
**<a href="#" onclick="window.open('signature_pad.php?id=<?php echo $myId; ?>', 'newwindow', 'width=500,   height=200');    return false;"><input type="button" value="Get Signature" /></a>**

上記の例では、2 つの目的で php を使用しています。最初にクエリ文字列 ID を受け取り、それを変数に保存してから、変数$myIdを window.open に必要な HTML の場所に出力します。直接印刷することもできますが$_GET、サニタイズなどの変数に対してさらに何かを行う必要がある場合に備えて、私はそうしないことを好みます.

詳細については、$_GET

于 2013-06-11T04:26:17.763 に答える