[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 672
  • Last Modified:

Submit form then load iframe

I have a form that submits various information. I need the next page to load in an iframe when I click the submit button.

Here is my first feeble attempt that isn't working:
<form name="m1_dynamic_link_element_add" method="post" action="<%= response.encodeURL("DynamicLinkElementAddExecuteServlet") %>">
			<%@ include file="/includes/error_message.jsp" %>
				<input type="hidden" name="action" value="">
			<input type="hidden" name="success" value="m1_dynamic_link_2nd.jsp">
				<input type="hidden" name="error" value="<%= request.getServletPath() %>">
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_PAGES_ID %>" value="<%= ResponseBean.getDynamicPagesID(0) %>">
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_M_COUNT %>" value="5" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_PLACEMENT %>" value="" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_COORDS %>" value="1213" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_MAIN_WIDTH %>" value="<%= ResponseBean.getDefaultLinkMainWidth(0) %>" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_MAIN_COLOR %>" value="<%= ResponseBean.getDefaultLinkMainColor(0) %>" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_MAIN_HIGHLIGHT %>" value="<%= ResponseBean.getDefaultLinkMainHighlight(0) %>" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_MAIN_HEIGHT %>" value="<%= ResponseBean.getDefaultLinkMainHeight(0) %>" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_MAIN_FONT_FACE %>" value="<%= ResponseBean.getDefaultLinkMainFontFace(0) %>" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_MAIN_FONT_COLOR %>" value="<%= ResponseBean.getDefaultLinkMainFontColor(0) %>" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_MAIN_FONT_SIZE %>" value="<%= ResponseBean.getDefaultLinkMainFontSize(0) %>" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_SUB_COLOR %>" value="<%= ResponseBean.getDefaultLinkSubColor(0) %>" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_SUB_HIGHLIGHT %>" value="<%= ResponseBean.getDefaultLinkSubHighlight(0) %>" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_SUB_TRANSPARENCY %>" value="<%= ResponseBean.getDefaultLinkSubTransparency(0) %>" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_SUB_FONT_COLOR %>" value="<%= ResponseBean.getDefaultLinkSubFontColor(0) %>" />
				<input type="hidden" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_SUB_FONT_SIZE %>" value="<%= ResponseBean.getDefaultLinkSubFontSize(0) %>" />
				<input id="newLinkBar" name="<%= com.ideaorbit.servlets.DynamicLinkElementAddExecuteServlet.HTTP_REQUEST_FIELD_KEY_DYNAMIC_LINK_ELEMENT_NAME %>" type="text">
				<a style="text-decoration:none" href="m1_dynamic_link_2nd.jsp" target="link_nav2" onclick="window.open(this.href, this.target)"><input type="submit" value="Next &gt;&gt;"></a><br><br>
				
				</form>
	<div class="designiframe">
		<iframe src="m1_dynamic_link_prenav2.jsp" id="link_nav2" frameborder="0" width="100%" height="380" scrolling="no">
		If you can see this, your browser does not support iframes!
		</iframe>
	</div>

Open in new window

0
Shaye Larsen
Asked:
Shaye Larsen
  • 2
1 Solution
 
DimitrisSenior Solution ArchitectCommented:
you can set as target of the <form> tag the iframe name
this will cause the form to be submited inside the IFRAME window.
0
 
Shaye LarsenAuthor Commented:
Thanks that worked! At first it didn't because I thought it would target the iframe according to the id. So I added a name to the iframe and targeted it and it worked.
0
 
Shaye LarsenAuthor Commented:
Thanks a ton!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now