HTML自动发布 [英] html post automatically

查看:76
本文介绍了HTML自动发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:

 <%@ page language =javapageEncoding =UTF-8contentType =text / html; charset = utf-8%> 
<%
//一些代码
%>

<!DOCTYPE HTML PUBLIC - // W3C // DTD HTML 4.01 Transitional // EN
http://www.w3.org/TR/html4/loose。 DTD>
< html>
< head>
< meta http-equiv =Content-Typecontent =text / html; charset = ISO-8859-1>
< title> Temp< / title>
< / head>
< body>
< form name =EventConfirmRedirectionmethod =postaction =event-buy-ticket.jsp>
< input type =hiddenvalue =<%= seance_id%> id =seanceIdname =seanceId>< / input>
< input type =hiddenvalue =<%= selected_seat_count%> id =urlFieldname =seatCount>< / input>
< input type =hiddenvalue =<%= seat [0]%> id =seatId1name =seatId1>< / input>
< input type =hiddenvalue =<%= ticket_cost [0]%> id =ticketCost1name =ticketCost1>< / input>

< input type =submitvalue =Go>
< / form>
< / body>
< / html>

我可以将这些值发布到下一页。当我点击开始时,它会发布。没关系。问题是我不想使用< input type =submitvalue =Go> 或类似于屏幕上可见的内容。我正在尝试自动执行此操作。当这个页面到来时,它应该直接发布event-buy-ticket.jsp。

试图用javascript来做这件事,但我做不到。也许有一种简单的HTML方法。

解决方案

这应该可以通过javascript来实现。

  document.EventConfirmRedirection.submit(); 


Here is my code:

<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=utf-8"%>
<% 
// some code
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Temp </title>
</head>
<body>
<form name="EventConfirmRedirection" method="post" action="event-buy-ticket.jsp">
    <input type="hidden" value="<%=seance_id%>" id="seanceId" name="seanceId"></input>
    <input type="hidden" value="<%=selected_seat_count%>" id="urlField" name="seatCount"></input>
    <input type="hidden" value="<%=seat[0]%>" id="seatId1" name="seatId1"></input>
    <input type="hidden" value="<%=ticket_cost[0]%>" id="ticketCost1" name="ticketCost1"></input>

    <input type="submit" value="Go" >
</form> 
</body>
</html>

I can post the values to the next page. When I click "Go", it posts. That's OK. The problem is I don't want to use <input type="submit" value="Go"> or something like visible on the screen. I am trying to do this automatically. When this page come, then it should directly post "event-buy-ticket.jsp".

Tried to do this with javascript but i couldn't. Maybe there is a simple way with HTML.

解决方案

This should do the trick with javascript

document.EventConfirmRedirection.submit();

这篇关于HTML自动发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆