提交前的Prefill Marketo字段

时间:2016-11-23 09:50:44

标签: php jquery wordpress marketo

在提交Marketo表单时,它会进行一些处理并返回到同一页面。

我的要求

我想在所有Marketo字段中填入刚刚输入的数据(点击提交按钮之前输入的数据)的所有Marketo字段。

我尝试了什么

我使用了下面的代码,这是http://developers.marketo.com/blog/external-page-prefill/

中给出的
# Input load. Please do not change #
`dataset` = structure(list(JobName = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = "Job 1", class = "factor"),
    RunDateTime = structure(c(1479195000, 1479196617, 1479281400,
    1479281851, 1479367800, 1479368235), class = c("POSIXct",
    "POSIXt"), tzone = ""), EndRunDateTime = structure(c(1479195855,
    1479197916, 1479283032, 1479283032, 1479369407, 1479369407
    ), class = c("POSIXct", "POSIXt"), tzone = ""), Status = structure(c(1L,
    2L, 2L, 2L, 2L, 2L), .Label = c("failed", "successfull"), class = "factor"),
    GraphicColor = structure(c(2L, 1L, 1L, 1L, 1L, 1L), .Label = c("green",
    "red"), class = "factor")), .Names = c("JobName", "RunDateTime",
"EndRunDateTime", "Status", "GraphicColor"), row.names = c(NA,
6L), class = "data.frame")

# Original Script. Please update your script content here and once completed copy below section back to the original editing window #
vars <- c("RunDateTime", "EndRunDateTime")
dataset[vars] <- lapply(dataset[vars], as.POSIXct, format = "%Y-%m-%dT%H:%M:%S")
df <- with(dataset, data.frame(Name = JobName, Start = RunDateTime, End = EndRunDateTime, Status = Status))
library(ggplot2)
lims <- with(df, c(min(Start), max(End)))
ggplot(df, aes(color = Status)) +
geom_segment(aes(x = Start, xend = End, y = Name, yend = Name), size = 3) +
scale_x_datetime(date_breaks = "1 day", date_minor_breaks = "1 hour", limits = lims, labels = function(x) paste(format(x, "%a \n %d.%m.%y"))) +
xlab(NULL) +
ylab(NULL) +
scale_colour_manual(values = c("successfull" = "#a1d99b", "failed" = "red", "repeated" = "yellow", "canceled" = "grey")) +
theme_bw()

但是当表单提交并加载\返回时,它没有填充previos输入的数据

1 个答案:

答案 0 :(得分:0)

我检查了声明的变量 - 这里是

  

var mktoLeadFields

(在Q中给出)并制作了一个逻辑,将预先输入的值分配给该var,然后在使用

设置表单值时
form.vals(prefillFields);

它有效。