SharePoint 在线表单处理
SharePoint Online Form Processing
我写了一个简单的 HTML/PHP 表单,它从表单中获取输入并输出到 HTML 以创建公司标准电子邮件签名。它只是将表单字段中的字符串回显到签名的 HTML 中。
表格:
<form action="sig.php" method="post">
Full Name: <input type="text" name="fullName"><br>
Job Title: <input type="text" name="jobTitle"><br>
Direct Phone Number (xxx.xxx.xxxx) <input type="text" name="phoneNumber"><br>
Email: <input type="text" name="email"><br>
<input type="submit">
</form>
PHP:
<div style="font-size:10pt; font-family:'Arial',sans-serif;color:#0E5881">
Please copy/paste the following into your email signature:
</div>
<hr>
<br>
<br>
<div style="font-size:12pt; font-family:'Arial',sans-serif;color:#133467">
<b><?php echo $_POST["fullName"]; ?></b>
</div>
<div style="font-size:10pt; font-family:'Arial',sans-serif;color:#0E5881">
<?php echo $_POST["jobTitle"]; ?>
</div>
<div style="font-size:10pt; font-family:'Arial',sans-serif;color:#656565">
Direct:</b> <?php echo $_POST["phoneNumber"]; ?>
<br>
<a href="mailto:<?php echo $_POST["email"]; ?>"><?php echo $_POST["email"]; ?></a> | <a href="http://www.example.com">www.Example.com</a>
</div>
<br>
<div style="font-size:20pt; font-family:'Arial',sans-serif;color:#676767">
<b>Example.com</b>
效果很好,但现在他们告诉我他们想把它放在我们公司的 SharePoint Online 网站上。
据我所知,无法在 SharePoint 上 运行 PHP。我也无法使用 PageViewer Web 部件。
通过 SharePoint 执行此操作的最佳选择是什么?在 SharePoint 中 运行 的客户端?我认为 Java 脚本是一个选项,但我对此一无所知。我知道 SharePoint 使用 ASP,但我对此知之甚少。
如有任何帮助,我们将不胜感激!
PHP 是服务器端代码,您不能将其添加到 SharePoint online 中,除非您愿意编写自己的 SharePoint 应用程序。
对于这样的事情,你最好的选择可能只是一个包含一些 JavaScript.
的页面
document.getElementById("btnSubmit").addEventListener("click", function() {
document.getElementById("signaturePanel").style.display = "inherit";
document.getElementById("fullNameOut").innerHTML = document.getElementById("fullName").value;
document.getElementById("jobTitleOut").innerHTML = document.getElementById("jobTitle").value;
document.getElementById("phoneNumberOut").innerHTML = document.getElementById("phoneNumber").value;
var email = document.getElementById("email").value;
var emailOut = document.getElementById("emailOut");
emailOut.innerHTML = email;
emailOut.href = "mailto:" + email;
document.getElementById("socialOut").style.display = document.getElementById("social").checked ? "inherit" : "none";
});
Full Name:
<input type="text" id="fullName" />
<br>Job Title:
<input type="text" id="jobTitle" />
<br>Direct Phone Number (xxx.xxx.xxxx)
<input type="text" id="phoneNumber" />
<br>Email:
<input type="text" id="email" />
<br>
<input type="checkbox" id="social" checked="checked" />Include social media links
<br/>
<input type="button" id="btnSubmit" value="submit" />
<div id="signaturePanel" style="display:none">
<div style="font-size:10pt; font-family:'Arial',sans-serif;color:#0E5881;">
Please copy/paste the following into your email signature:
</div>
<hr>
<br>
<br>
<div style="font-size:12pt; font-family:'Arial',sans-serif;color:#133467">
<b><span id="fullNameOut"></span></b>
</div>
<div style="font-size:10pt; font-family:'Arial',sans-serif;color:#0E5881">
<span id="jobTitleOut"></span>
</div>
<div style="font-size:10pt; font-family:'Arial',sans-serif;color:#656565">
Direct:</b> <span id="phoneNumberOut"></span>
<br>
<a id="emailOut" href="mailto:"></a> | <a href="http://www.example.com">www.Example.com</a>
</div>
<br>
<div style="font-size:20pt; font-family:'Arial',sans-serif;color:#676767">
<b>Example.com</b>
<div id="socialOut" style="display:none">
<a href="http://example.com">
<img src="https://placeholdit.imgix.net/~text?txtsize=15&txt=twitter+link&w=90&h=90&txttrack=0" />
</a>
</div>
</div>
我写了一个简单的 HTML/PHP 表单,它从表单中获取输入并输出到 HTML 以创建公司标准电子邮件签名。它只是将表单字段中的字符串回显到签名的 HTML 中。
表格:
<form action="sig.php" method="post">
Full Name: <input type="text" name="fullName"><br>
Job Title: <input type="text" name="jobTitle"><br>
Direct Phone Number (xxx.xxx.xxxx) <input type="text" name="phoneNumber"><br>
Email: <input type="text" name="email"><br>
<input type="submit">
</form>
PHP:
<div style="font-size:10pt; font-family:'Arial',sans-serif;color:#0E5881">
Please copy/paste the following into your email signature:
</div>
<hr>
<br>
<br>
<div style="font-size:12pt; font-family:'Arial',sans-serif;color:#133467">
<b><?php echo $_POST["fullName"]; ?></b>
</div>
<div style="font-size:10pt; font-family:'Arial',sans-serif;color:#0E5881">
<?php echo $_POST["jobTitle"]; ?>
</div>
<div style="font-size:10pt; font-family:'Arial',sans-serif;color:#656565">
Direct:</b> <?php echo $_POST["phoneNumber"]; ?>
<br>
<a href="mailto:<?php echo $_POST["email"]; ?>"><?php echo $_POST["email"]; ?></a> | <a href="http://www.example.com">www.Example.com</a>
</div>
<br>
<div style="font-size:20pt; font-family:'Arial',sans-serif;color:#676767">
<b>Example.com</b>
效果很好,但现在他们告诉我他们想把它放在我们公司的 SharePoint Online 网站上。
据我所知,无法在 SharePoint 上 运行 PHP。我也无法使用 PageViewer Web 部件。
通过 SharePoint 执行此操作的最佳选择是什么?在 SharePoint 中 运行 的客户端?我认为 Java 脚本是一个选项,但我对此一无所知。我知道 SharePoint 使用 ASP,但我对此知之甚少。
如有任何帮助,我们将不胜感激!
PHP 是服务器端代码,您不能将其添加到 SharePoint online 中,除非您愿意编写自己的 SharePoint 应用程序。
对于这样的事情,你最好的选择可能只是一个包含一些 JavaScript.
的页面document.getElementById("btnSubmit").addEventListener("click", function() {
document.getElementById("signaturePanel").style.display = "inherit";
document.getElementById("fullNameOut").innerHTML = document.getElementById("fullName").value;
document.getElementById("jobTitleOut").innerHTML = document.getElementById("jobTitle").value;
document.getElementById("phoneNumberOut").innerHTML = document.getElementById("phoneNumber").value;
var email = document.getElementById("email").value;
var emailOut = document.getElementById("emailOut");
emailOut.innerHTML = email;
emailOut.href = "mailto:" + email;
document.getElementById("socialOut").style.display = document.getElementById("social").checked ? "inherit" : "none";
});
Full Name:
<input type="text" id="fullName" />
<br>Job Title:
<input type="text" id="jobTitle" />
<br>Direct Phone Number (xxx.xxx.xxxx)
<input type="text" id="phoneNumber" />
<br>Email:
<input type="text" id="email" />
<br>
<input type="checkbox" id="social" checked="checked" />Include social media links
<br/>
<input type="button" id="btnSubmit" value="submit" />
<div id="signaturePanel" style="display:none">
<div style="font-size:10pt; font-family:'Arial',sans-serif;color:#0E5881;">
Please copy/paste the following into your email signature:
</div>
<hr>
<br>
<br>
<div style="font-size:12pt; font-family:'Arial',sans-serif;color:#133467">
<b><span id="fullNameOut"></span></b>
</div>
<div style="font-size:10pt; font-family:'Arial',sans-serif;color:#0E5881">
<span id="jobTitleOut"></span>
</div>
<div style="font-size:10pt; font-family:'Arial',sans-serif;color:#656565">
Direct:</b> <span id="phoneNumberOut"></span>
<br>
<a id="emailOut" href="mailto:"></a> | <a href="http://www.example.com">www.Example.com</a>
</div>
<br>
<div style="font-size:20pt; font-family:'Arial',sans-serif;color:#676767">
<b>Example.com</b>
<div id="socialOut" style="display:none">
<a href="http://example.com">
<img src="https://placeholdit.imgix.net/~text?txtsize=15&txt=twitter+link&w=90&h=90&txttrack=0" />
</a>
</div>
</div>