JQuery form trigger and action



<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/WEB-INF/pages/component/meta.jsp" %>
<%@ include file="/WEB-INF/pages/component/datatable.jsp" %>
<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath()%>/display/accordion/style.css" />
<title><spring:message code="roomwanted.title" text="Advertise room wanted"/></title>
<script type="text/javascript">

function doPost(advType){
if(advType == 'room')
$('#srch').attr('action', '<%=request.getContextPath()%>/searchroom.k');
else if (advType == 'tenant')
$('#srch').attr('action', '<%=request.getContextPath()%>/searchtenant.k');
$("#srch").trigger("submit");
}
</script>
</head>
<body>

<div class="wrapper">

<%@ include file="/WEB-INF/pages/component/sidebar.jsp"%>

<div id="pageContent">


<div class="wikistyle">

<div id="sitetext">
<h1>
<a href="<%=request.getContextPath()%>" style="text-decoration: none">kameroom.nl</a>
</h1>
</div>

<div class="menu">
<%@ include file="/WEB-INF/pages/component/dropdown.jsp"%>
</div>

<div id="welcometext">
<h2 style="padding: 0 !important;"></h2>
</div>

<div id="container">
<div id="wrap">
<div id="main">
<pre class="noteyellow"><spring:message code="advert.free" text="Finding a new room or tenant here is easy and fast"/></pre>
<br/>
<form name="srchForm" id="srch" method="post">
<ul id="stepForm">
<li id="sf1">
<div>
<fieldset>
<h3 class="stepHeader">Find the room you want easily</h3>
<div class="buttonWrapper">
<center>
<input name="formNext1" type="button" class="open1 nextbutton3" value="Search a new room" onclick="doPost('room')"/>
</center>
</div>
</fieldset>
</div>
</li>
<li id="sf1">
<div>
<fieldset>
<h3 class="stepHeader">Find a new tenant for your room</h3>
<div class="buttonWrapper">
<center>
<input name="formNext1" type="button" class="open1 nextbutton3" value="Search a new tenant" onclick="doPost('tenant')"/>
</center>
</div>
</fieldset>
</div>
</li>
</ul>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

Advertisements

One thought on “JQuery form trigger and action

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s