小编mat*_*att的帖子

JavaScript表单提交 - 确认或取消提交对话框

对于一个带有警告的简单表单,询问字段是否填写正确,我需要一个执行此操作的函数:

  • 单击按钮时显示警告框,有两个选项:

    • 如果单击"确定",则提交表单
    • 如果单击取消,则会关闭警报框,并可以调整并重新提交表单

我认为JavaScript确认可行,但我似乎无法弄清楚如何.

我现在的代码是:

function show_alert() {
  alert("xxxxxx");
}
Run Code Online (Sandbox Code Playgroud)

html javascript forms confirm submit

168
推荐指数
4
解决办法
36万
查看次数

使用 xsl 谓词根据另一个节点的值选择一个节点

与此问题类似的问题: XPath: select a node based on another node?

目标是根据同级节点的值选择一个节点——在本例中是基于 Pagetype 节点的值的 Pagetitle 节点。

路径:

/dsQueryResponse/Rows/Row/@Title
/dsQueryResponse/Rows/Row/@Pagetype
/dsQueryResponse/Rows/Row/@Pagetitle
Run Code Online (Sandbox Code Playgroud)

这个 xsl 没有返回任何东西:

<xsl:value-of select= "/dsQueryResponse/Rows/Row[Pagetype='Parent']/@Pagetitle" />  
Run Code Online (Sandbox Code Playgroud)

示例 xml:

<dsQueryResponse>
       <Rows>
            <Row>
               <Title>1</Title>
               <Pagetype>Parent</Pagetype>
               <Pagetitle>title of page</Pagetitle>
            </Row>
        </Rows>
</dsQueryResponse>  
Run Code Online (Sandbox Code Playgroud)

目标是返回 Pagetitle 的值,如果它们的 Pagetype 值为“Parent”。

xml xslt sharepoint xpath predicates

5
推荐指数
1
解决办法
7849
查看次数

标签 统计

confirm ×1

forms ×1

html ×1

javascript ×1

predicates ×1

sharepoint ×1

submit ×1

xml ×1

xpath ×1

xslt ×1