Capture external form inputs embedded on my WordPress - webforms

I have embedded this form on my website FREE SEO AUDIT:
<div id="seo-audit-form-div"><script type="text/javascript" id="seo-audit-form" src="https://www.octoboard.com/scripts/seo-audit-form.js?_id_agp_665760"></script></div>
that represents on load to:
<div id="seo-audit-form-div"><script type="text/javascript" id="seo-audit-form" src="https://www.octoboard.com/scripts/seo-audit-form.js?_id_agp_665760">
</script><div>
<link href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,400,600,700,800" rel="stylesheet">
<style>
#inputs {display: flex !important;margin:0 0 0 140px !important;}
#seoAuditForm {opacity:0;-webkit-transition: opacity .6s;-moz-transition: opacity .6s;-o-transition: opacity .6s;transition: opacity .6s;}
.label {display:flex !important;align-items:center !important;justify-content:center !important;min-width:140px !important;width:140px !important;background-color: #405668 !important;color:#ffffff !important;z-index:1 !important;}
.formInput{font-size:16px !important;border-radius:4px !important;border:1px solid #A9A9A9 !important;left:-4px !important;position: relative !important;z-index:0 !important;width:100% !important;overflow:hidden !important;text-overflow:ellipsis !important;white-space:nowrap !important;margin: 0 !important;padding: 0 0 0 8px !important;height:36px !important;box-sizing:content-box !important;-moz-box-sizing:content-box !important;}
.formInputContainer{display: flex !important;flex-grow:1 !important;margin:0 6px 10px 0 !important;border-radius:4px !important;border:none !important;overflow:hidden !important;height:38px !important;}
.checkTextContainer{display:flex !important;align-items:center !important;justify-content:center !important;margin-left:5px !important;color:#CC4F3F !important;font-size:10px !important;font-weight:400 !important;}
.redText{color:#C45E53 !important;}
#websiteLabel {display:flex !important;align-items:center !important;justify-content:center !important;width: 140px !important; font-size: 28px !important; font-weight: 600 !important; color: #ffffff !important; height: 44px !important; margin: 0 10px 0 5px !important;}
#buttonBlock {display:flex !important;justify-content:flex-end !important;margin:0 10px 0 0 !important;}
#_website {width:100% !important;height:38px !important;margin:0 10px 10px 0 !important;font-size:16px !important;padding:0 0 0 10px !important;border-radius:4px !important;border:1px solid #A9A9A9 !important;}
#seoFormButton {cursor:pointer !important;width:320px !important;height:48px !important;background:none !important;background-color:#405668 !important;display:flex !important;align-items:center !important;justify-content:center !important;color:#ffffff !important;border-radius:4px !important;border:none !important;font-size:18px !important;padding:2px 20px 0 20px !important;}
#buttonContainer {display:flex !important;flex-direction:column !important;}
#media (max-width:600px) {
.label {display:none !important;}
.formInput {left:0 !important;}
#inputs {margin:0 0 0 0 !important;}
#websiteLabel {display:none !important;}
.formInputContainer {margin:0 0 10px 0 !important;}
#_website {margin:0 0 10px 0 !important;}
}
#media (max-width:450px) {
#seoFormButton {width:100% !important;}
#buttonContainer {width:100% !important;}
#buttonBlock {margin:0 0 0 0 !important;}
}
</style>
<div style="padding:23px 23px 23px 23px !important;background-color:RGBA(0,0,0,0) !important;font-family:Nunito Sans,sans-serif !important;">
<form class="" id="seoAuditForm" style="opacity: 1;" data-hs-cf-bound="true">
<div style="display: flex !important;">
<div id="websiteLabel">WEBSITE</div>
<input type="url" size="40" id="_website" placeholder="Enter your domain">
</div>
<div id="inputs" style="flex-direction: column;">
<div class="formInputContainer">
<div class="label">NAME</div>
<input class="formInput" type="text" size="40" id="_name" placeholder="Enter your name">
</div>
<div class="formInputContainer">
<div class="label">EMAIL</div>
<input class="formInput" type="text" size="40" id="_email" placeholder="Enter your email">
</div><div class="formInputContainer">
<div class="label">PHONE</div>
<input class="formInput" type="text" size="40" id="_phone" placeholder="Enter your phone number">
</div>
</div>
<div id="buttonBlock">
<div id="buttonContainer">
<div style="display:flex !important;justify-content:flex-end !important;align-items:center !important;margin:0 0 20px 0 !important;">
<input type="checkbox" id="consent" style="margin: 0 !important;">
<span style="display:flex !important;margin:0 0 0 5px !important;color:#ffffff !important;font-size:14px !important;font-weight:400 !important;opacity:0.87 !important;">I agree to Terms and Conditions.</span>
</div>
<button type="button" id="seoFormButton" class="" name="">RUN AUDIT</button>
<div style="display:flex !important;justify-content:flex-end !important;min-height:20px !important;margin:5px 0 0 0 !important;">
<div id="checkEmailAndDomain" style="display:none;">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="12" viewBox="0 0 13.309 11.494"><defs><style>.a{fill:#cc4f3f;}</style></defs><path class="a" d="M1,13.494H14.309L7.655,2Zm7.259-1.815H7.05v-1.21h1.21Zm0-2.42H7.05V6.84h1.21Z" transform="translate(-1 -2)"></path></svg>
<span class="checkTextContainer">Please enter email address and domain to generate SEO Audit.</span>
</div>
<div id="checkConsent" style="display:none;">
<svg xmlns="http://www.w3.org/2000/svg" width="13" height="12" viewBox="0 0 13.309 11.494"><defs><style>.a{fill:#cc4f3f;}</style></defs><path class="a" d="M1,13.494H14.309L7.655,2Zm7.259-1.815H7.05v-1.21h1.21Zm0-2.42H7.05V6.84h1.21Z" transform="translate(-1 -2)"></path></svg>
<span class="checkTextContainer">Please tick the checkbox and accept our conditions.</span>
</div>
</div>
</div>
</div>
</form>
</div></div></div>
I need to collect these inputs and send them to a webhook.
Is there any way to collect the input fields in this form and send it to a webhook after submit?
I've tried a few listening scripts but was unsuccessful.

Related

Can't resize gap, widht and height on sass with media query

I'm resizing a card with media query but the labels I've created inside it gets weird because of the gap from the parent div. I know I can fix it changing the gap of the parent div and the widht and height of the labels, but I'm not beeing able to do that.
It stays like this
I want it to be like this
I'm using SASS and bootstrap 5.3.0.
This is a challenge from Frontend Mentor btw.
HTML:
<div class="card" id="submitCard">
<div class="star"><img src="images/icon-star.svg" alt=""></div>
<p class="cardTitle">How did we do?</p>
<p class="cardDescription">Please let us know how we did with your support request. All feedback is appreciated to help us improve our offering!</p>
<form id="ratingForm">
<div class="inputs">
<input type="radio" name="rating" id="rating1" value="1"></input>
<label for="rating1">1</label>
<input type="radio" name="rating" id="rating2" value="2"></input>
<label for="rating2">2</label>
<input type="radio" name="rating" id="rating3" value="3"></input>
<label for="rating3">3</label>
<input type="radio" name="rating" id="rating4" value="4"></input>
<label for="rating4">4</label>
<input type="radio" name="rating" id="rating5" value="5"></input>
<label for="rating5">5</label>
</div>
<button class="submitBtn">Submit</button>
</form>
</div>
CSS:
#submitCard{
#ratingForm{
color: var(--text-color);
margin-top: 10px;
.inputs{
display: flex;
justify-content: space-between;
gap: 20px;
label{
display: grid;
place-content: center;
background-color: var(--btn-color);
border-radius: 50px;
width: 50px;
height: 50px;
padding-top: 5px;
}
input[type="radio"]{
display: none;
&:checked + label {
background-color: var(--btn-selected-color);
color: var(--white);
}
&:hover + label{
background-color: var(--primary);
color: var(--white);
cursor: pointer;
}
}
}
}
}
Media query:
#media (max-width: 430px){
.card{
width: 360px;
padding: 25px;
border-radius: 15px;
}
#submitCard {
#ratingForm{
.inputs {
gap: 0;
label{
width: 45px;
height: 45px;
}
}
}
}
}
Well.. The thing is: I placed my media query before the styles I was trying to change. I guess i'm going back to practice. 😂🤡
I found the answer by this post: Css id's don't change on media queries

golang iris web template i use safe fail,how to convert string to html?

golang template how to convert string to html,i use {{.links|safe}} but get error message
function "safe" not defined
and How to optimize the code, I just started learning golang。
Or you can write a data structure if you render a structure in templat, such as Button struct.
Are there more examples of template usage?
button := []Button{
{Name: "admin", Link: "/system/"},
{Name: "index", Link: "/"},
}
to html
layer.open({
type: 1
,title: false
,closeBtn: false
,area: '300px;'
,shade: 0.8
,id: 'LAY_layuipro'
,btn: ["admin","index"]
,btnAlign: 'c'
,moveType: 1
,content: '<div style="padding: 50px; line-height: 22px;font-weight: 300;"> layer.msg(安装成功)</div>'
,success: function(layero){
var btn = layero.find('.layui-layer-btn');
btn.find('.layui-layer-btn0').attr({href: '/system/',target: '_blank'});btn.find('.layui-layer-btn1').attr({href: '/',target: '_blank'});
}
});
views code
type Button struct {
Name string
Link string
}
func Install(ctx iris.Context) {
fmt.Println("........")
if dao.DB != nil {
ctx.Redirect("/")
return
}
templateName := "install.html"
button := []Button{
{Name: "admin", Link: "/system/"},
{Name: "index", Link: "/"},
}
links := ""
var btns []string
i := 0
for _, btn := range button {
links += fmt.Sprintf("btn.find('.layui-layer-btn%v').attr({href: '%v',target: '_blank'});", i, btn.Link)
btns = append(btns, btn.Name)
i += 1
}
data := iris.Map{
"message": "安装成功",
"btns": btns,
"links": links,
}
ctx.View(templateName, data)
return
}
template
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>初始化安装</title>
<style>
.container {
padding: 30px;
}
.title {
text-align: center;
padding: 20px;
}
.layui-form {
max-width: 600px;
margin: 50px auto;
padding: 20px;
max-width: 600px;
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
border-radius: 5px;
}
.layui-form-item {
display: flex;
margin-bottom: 20px;
align-items: top;
}
.layui-form-label {
padding: 6px 0;
width: 100px;
}
.layui-input-block {
flex: 1;
}
.layui-input {
box-sizing: border-box;
width: 100%;
padding: 2px 10px;
border: 1px solid #eaeaea;
border-radius: 4px;
height: 36px;
font-size: 15px;
}
input:focus,
textarea:focus {
outline: 1px solid #29d;
}
.layui-form-mid {
padding: 3px 0;
}
.layui-aux-word {
color: #999;
font-size: 12px;
}
.layui-btn {
cursor: pointer;
border-radius: 2px;
color: #555;
background-color: #fff;
padding: 10px 15px;
margin: 0 5px;
border: 1px solid #eaeaea;
}
.layui-btn.btn-primary {
color: #fff;
background-color: #3f90f9;
}
.submit-buttons {
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<h1 class="title">安企CMS(AnqiCMS)初始化安装</h1>
<form class="layui-form" action="/install" method="post">
<div>
<div class="layui-form-item">
<label class="layui-form-label">数据库地址</label>
<div class="layui-input-block">
<input type="text" name="host" value="localhost" required placeholder="一般是localhost"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">数据库端口</label>
<div class="layui-input-block">
<input type="text" name="port" value="3306" required placeholder="一般是3306" autocomplete="off"
class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">数据库名称</label>
<div class="layui-input-block">
<input type="text" name="database" value="anqicms" required placeholder="安装到哪个数据库"
autocomplete="off" class="layui-input">
<div class="layui-form-mid layui-aux-word">如果数据库不存在,程序则会尝试创建它</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">数据库用户</label>
<div class="layui-input-block">
<input type="text" name="user" required placeholder="填写数据库用户名" autocomplete="off"
class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">数据库密码</label>
<div class="layui-input-block">
<input type="password" name="password" required placeholder="填写数据库密码" autocomplete="off"
class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">后台用户名</label>
<div class="layui-input-block">
<input type="text" name="admin_user" value="admin" required placeholder="用于登录管理后台"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">后台密码</label>
<div class="layui-input-block">
<input type="password" name="admin_password" minlength="6" maxlength="20" required
placeholder="请填写6位以上的密码" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">网站地址</label>
<div class="layui-input-block">
<input type="text" name="base_url" value="" autocomplete="off" class="layui-input">
<div class="layui-form-mid layui-aux-word">
指该网站的网址,如:https://www.anqicms.com,用来生成全站的绝对地址
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block submit-buttons">
<button type="reset" class="layui-btn">重置</button>
<button class="layui-btn btn-primary" type="submit">确认初始化</button>
</div>
</div>
</form>
</div>
</body>
<script src="https://www.layuicdn.com/layui/layui.js"></script>
<script>
{{ if .message }}
{{ $length := len .btns }}{{ if eq $length 0 }}
layer.msg({{.message}})
{{else}}
layer.open({
type: 1
,title: false //不显示标题栏
,closeBtn: false
,area: '300px;'
,shade: 0.8
,id: 'LAY_layuipro' //设定一个id,防止重复弹出
,btn: {{.btns}}
,btnAlign: 'c'
,moveType: 1 //拖拽模式,0或者1
,content: '<div style="padding: 50px; line-height: 22px;font-weight: 300;"> layer.msg({{.message}})</div>'
,success: function(layero){
var btn = layero.find('.layui-layer-btn');
{{.links}}
}
});
{{end}}
{{ end }}
</script>
</html>
generate html
layer.open({
type: 1
,title: false
,closeBtn: false
,area: '300px;'
,shade: 0.8
,id: 'LAY_layuipro'
,btn: ["admin","index"]
,btnAlign: 'c'
,moveType: 1
,content: '<div style="padding: 50px; line-height: 22px;font-weight: 300;"> layer.msg(安装成功)</div>'
,success: function(layero){
var btn = layero.find('.layui-layer-btn');
"btn.find('.layui-layer-btn0').attr({href: '/system/',target: '_blank'});btn.find('.layui-layer-btn1').attr({href: '/',target: '_blank'});"
}
});
i want to result
layer.open({
type: 1
,title: false
,closeBtn: false
,area: '300px;'
,shade: 0.8
,id: 'LAY_layuipro'
,btn: ["admin","index"]
,btnAlign: 'c'
,moveType: 1
,content: '<div style="padding: 50px; line-height: 22px;font-weight: 300;"> layer.msg(安装成功)</div>'
,success: function(layero){
var btn = layero.find('.layui-layer-btn');
btn.find('.layui-layer-btn0').attr({href: '/system/',target: '_blank'});btn.find('.layui-layer-btn1').attr({href: '/',target: '_blank'});
}
});

Change size on hover of one flex element with overlapping another

Change size on hover of one flex element with overlapping another.
Like this
You can use CSS transform property like this
selector {
... /* others styles */
transition: 0.4s;
}
selector:hover {
transform: scaleY(1.2)
}
refer https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale()
<div class="flex justify-content-evenly align-items-start flex-wrap">
<div class="relative container w-full w-3 h-22rem">
<div class="item-container grid inline absolute top-0 left-0">
<div class="text-center col">
<img class="w-full" src="assets/images/buket2.png" alt="buket">
</div>
<div class="col">
<h5 class="m-0">Bouquet 117 (21 gerberas)</h5>
<p class="text-400 text-sm font-medium mt-1">Fresh flowers</p>
<p class="font-bold">€83.49 EUR</p>
</div>
<button label="Add to cart" icon="pi pi-shopping-cart">
</button >
</div>
</div>
.item-container {
border: 1px solid #E7E7E7;
box-sizing: border-box;
border-radius: 10px;
margin: 15px 0 15px 0;
padding: 20px 20px 0 20px;
background-color: white;
&:hover {
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
z-index: 2;
.buy-btn {
display: block !important;
}
}
}

Center align the picture

Why this image is not centrally align?
<div style=" width:70%; margin:0 auto; padding:0.2%; border:1px solid #000; ">
<img src="images/social.png" width="227" height="68" style="border:1px solid #000;
border-radius:5px; width:auto; margin:0 auto; display:block;" /></div>
Its the simple question. Any quick solution please.
Thanks,
Its simple try using line height property and set its value in px equivalent to the height of the container e.g
//container
<div class="container" align="center">
<img src="http://static.adzerk.net/Advertisers/46a9844d6e504212a85bc72ddd7dd829.png" width="40" height="40">
</div>
//css
.container{
width:200px;
height:200px;
line-height:200px;
border:1px solid #666;
margin:0 auto;
}

Multiple images per transition in jquery Cycle

I have the following HTML code:
<section class="gallery">
prev
next
<div class="holder">
<ul id="slider">
<li>
<img src="" alt="#" width="306" height="240" />
<span>Picture Title</span>
</li>
<li>
<img src="" alt="#" width="306" height="240" />
<span>Picture Title</span>
</li>
<li>
<img src="" alt="#" width="306" height="240" />
<span>Picture Title</span>
</li>
<li>
<img src="" alt="#" width="306" height="240" />
<span>Picture Title</span>
</li>
</ul>
</div>
</section>
And the following js:
$(document).ready(function(){
$('#slider').cycle({
fx:'scrollHorz',
timeout: 5000,
prev:'#link-prev',
next: '#link-next'
})
//$(".form-contact form").validate();
})
This works fine, but it shows just one picture, and if I want to see the following I click next, and if I want to see the previous, I click prev. How can I show more than one picture per transition?
Basically, like this example: scroll, but showing more than one picture per transition...
EDIT: The actual HTML I have when trying to have two pictures in each slide is this one:
<section class="gallery">
prev
next
<div class="holder">
<ul id="slider">
<div>
<img src="assets/content/pages/carrousell/UrbanFlame.jpg" alt="#" width="306" height="240" />
<img src="assets/content/pages/carrousell/TannourineRestaurant.jpg" alt="#" width="306" height="240" />
</div>
<div>
<img src="assets/content/pages/carrousell/PanchoVillaTaqueria.jpg" alt="#" width="306" height="240" />
<img src="assets/content/pages/carrousell/LaLanterna.jpg" alt="#" width="306" height="240" />
</div>
</ul>
</div>
</section>
And the CSS is this one:
.gallery .holder{
border-radius: 10px;
position:relative;
padding:4px 0 4px 0px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
.gallery #link-prev,
.gallery #link-next{
position:absolute;
width:47px;
height:83px;
text-indent:-9999px;
overflow:hidden;
top:75px;
z-index:99999;
background:url(navigati.png) no-repeat;
}
.gallery #link-prev{left:-19px;}
.gallery #link-next{right:-19px;}
.gallery #link-next{background-position:-48px 0;}
.gallery h3{
color:#33638b;
font-size:18px;
line-height:21px;
margin:0 0 1px;
text-align:center;
}
#slider{
padding:0;
width:306px;
margin: 0 auto;
}
#slider li{
list-style:none;
text-align:center;
color:#FFFFFF;
font-size:14px;
line-height:17px;
padding:0px 0 0;
width:306px;
}
#slider img{
position:relative;
}
#slider span{
width:286px;
display:block;
padding:20px 10px;
background:url(../images/slider_span_bg.jpg) repeat-x left top; height:18px;}
#slider a{color:#33638b; font-family:Arial, Helvetica, sans-serif; color:#fff; font-size:18px;}
What's inside your <!-- picture link !--> blocks?
According to the Cycle documentation (and samples) the markup should be like this:
<div id="slider">
<img src="image1.jpg" />
<img src="image2.jpg" />
<img src="image3.jpg" />
<!-- ... -->
</div>
EDIT:
Two pictures in one transition
var curElement = null;
$('#s1').cycle({
fx: 'scrollHorz',
prev: '#prev1',
next: '#next1',
timeout: 0,
after: function(currSlideElement, nextSlideElement, options, forwardFlag)
{
if (forwardFlag === 1 && (currSlideElement != curElement || curElement == null))
{
curElement = nextSlideElement;
$("#next1").trigger('click');
}
else if ( forwardFlag === 0 && (currSlideElement != curElement || curElement == null))
{
curElement = nextSlideElement;
$("#prev1").trigger('click');
}
}
});
EDIT 2
The problem is a #slider style. Set its width to f.e. 620px
#slider{
padding:0;
width:620px;
margin: 0 auto;
}
I'm not sure that the Cycle plug-in will handle that without editing the source.
It looks like this option could be useful though:
onPrevNextEvent: null,// callback fn for prev/next events: function(isNext, zeroBasedSlideIndex, slideElement)
It seems like you should be able to trigger a next or prev click onPrevNextEvent.
Something like this:
$('#slider').cycle({
fx:'scrollHorz',
timeout: 5000,
prev:'#link-prev',
next: '#link-next',
onPrevNextEvent: function(isNext) {
if(isNext) {
$('#link-next').trigger('click');
} else {
$('#link-prev').trigger('click');
}
}
})

Resources