Quform Unterschriftenfeld Signature Field

View Categories

Quform Unterschriftenfeld Signature Field

Sie sehen gerade einen Platzhalterinhalt von Standard. Um auf den eigentlichen Inhalt zuzugreifen, klicken Sie auf den Button unten. Bitte beachten Sie, dass dabei Daten an Drittanbieter weitergegeben werden.

Weitere Informationen

wenn mehr als ein feld:

Ally wrote:

Hi

So for Step 2 in the guide, you’d need to change the hidden input in the HTML for each signature to have a unique name, also add a class to simplify the JS later. The original field:

Becomes this for the first signature:

And this for the second signature:

And this for the third one:

In Step 3, make sure you have a File Upload field below each HTML element added in Step 2, and make a note of each File Upload element unique ID.

In Step 4, add the element-specific CSS to style each canvas, and in the Custom JavaScript code change this line:

$output = $root.find(‚input[name=“signature“]‘),

To:

$output = $root.find(‚.quform-signature‘),

For Step 5, use the code below instead of the code in the guide for lines 1-28:

add_filter(‚quform_pre_process_1′, function (array $result, Quform_Form $form) {
$fields = array(
’signature1‘ => ‚1_4′,
’signature2‘ => ‚1_12′,
’signature3‘ => ‚1_24‘,
);

foreach ($fields as $key => $id) {
if (isset($_POST[$key]) && Quform::isNonEmptyString($_POST[$key])) {
$tmpDir = Quform::getTempDir(‚quform/uploads‘);

if (!is_dir($tmpDir)) {
wp_mkdir_p($tmpDir);
}

if (is_writable($tmpDir)) {
// Save to temp location
$image = explode(‚,‘, stripslashes($_POST[$key]));
$image = base64_decode($image[1]);
$filename = tempnam($tmpDir, ‚quform-signature‘);
file_put_contents($filename, $image);

// Save the image into $_FILES
$_FILES[„quform_$id“] = array(
‚tmp_name‘ => array($filename),
’name‘ => array(’signature-‚ . uniqid() . ‚.png‘),
‚error‘ => array(UPLOAD_ERR_OK),
’size‘ => array(filesize($filename)),
‚type‘ => array(‚image/png‘)
);
}
}
}

return $result;
}, 10, 2);

On line 1 change the number 1 to the form ID, and on line 2-6 change the mapping of hidden field name to File Upload element unique ID to match your form.

Nach oben