「已注销」 2015-07-23 07:38 采纳率: 46.7%
浏览 6998
已采纳

在一个jsp页面中,点击一个按钮,弹出另一个jsp页面

add.jsp:图片说明
select.jsp:图片说明
如图,共有两个jsp页面,一个add.jsp
select.jsp,在add.jsp上面有一个请选择按钮,点击请选择按钮后,弹出select.jsp页面,这个页面上是从数据库中遍历的企业,选中一条数据,点击确认,select.jsp页面关闭,并将结果带到add.jsp请选择前面的文本框里面。现在两个jsp页面我已经做好了,那么应该如何才能够得到想要的结果,action层是如何实现的?拜求解决。

好吧,继续昨天的问题:
add.jsp
select.jsp
应该如何将所选择的值带回到add.jsp推荐企业后的文本框中。
(add.jsp源码:<br> function closeYmtPage() {<br> window.history.go(-1);<br> }<br> function findztype() {<br> var idstr = $(&quot;#fwdl&quot;).val();<br> $.post(&quot;fw.do?action=findzType&quot;,{idstr:idstr},function(data){<br> var types=eval(&#39;(&#39; + data + &#39;)&#39;);<br> var typelist = types.typesList;<br> $(&quot;#fwxl&quot;).empty();<br> $(&quot;#fwxl&quot;).append(&#39;<option value="">请选择</option>&#39;);<br> $.each(typelist, function (i, item) {<br><br> var str =&#39;<option value="'+item.id+'" title="'+item.name+'">&#39;+item.name+&#39;</option>&#39;;<br> $(&quot;#fwxl&quot;).append(str); <br> });<br> });<br> }</p> <pre><code> //推荐企业按钮 function openwindow(){ window.showModalDialog(&quot;/jxw/xq.do?action=showTjList&quot;,window, &quot;status:no;scroll:yes; dialogWidth:400px;dialogHeight:400px&quot;); } function addxm(flag){ $(&quot;#fbState&quot;).val(flag); var xqName =$(&quot;#xqName&quot;).val(); if(xqName ==&quot;&quot;) { alert(&quot;需求名称不能为空!&quot;); return; } if($(&quot;#fwdl&quot;).val()==&quot;&quot; || $(&quot;#fwXl&quot;).val()==&quot;&quot;){ alert(&quot;服务类别不能为空&quot;); return; } $(&quot;#addForm&quot;).ajaxSubmit({ beforeSubmit : function() { $(&quot;#saveBtn&quot;).attr(&quot;disabled&quot;, true); }, success : function(data) { var start = data.indexOf(&quot;&gt;&quot;); if (start != -1) { var end = data.indexOf(&quot;&lt;&quot;,start+1); if (end != -1) { data = data.substring(start+1, end); } } if (data == &quot;ok&quot;) { alert(&quot;添加需求成功&quot;); window.location.href=&#39;&lt;c:url value=&quot;cartweb.do?action=loadFwxqPage&amp;pageNo=1&quot;/&gt;&#39;; } if (data == &quot;error&quot;) { alert(&quot;添加需求失败&quot;); } $(&quot;#saveBtn&quot;).attr(&quot;disabled&quot;, false); }, complete : function() { $(&quot;#saveBtn&quot;).attr(&quot;disabled&quot;, false); }, error : function() { $(&quot;#saveBtn&quot;).attr(&quot;disabled&quot;, false); alert(&quot;请求错误&quot;); } }); } </code></pre> <p>function checkfkfs(){</p> <pre><code> var fkfs=$(&quot;#fkfs&quot;).val(); if(fkfs==&quot;2&quot;) { document.getElementById(&quot;price&quot;).disabled=&quot;disabled&quot;; }else{ $(&quot;#price&quot;).removeAttr(&quot;disabled&quot;); } } function addxqlc() { window.parent.document.getElementById(&quot;btnxqOk&quot;).click(); } &lt;/script&gt; </code></pre> <p></head></p> <p><body><br> <div class="main_nav"><br> <div class="lb_nav" id="current_pageDiv" style="width: 100%"><br> <div class="lb_nav_tu">添加需求</div><br> <a href="javascript:void(0)" onclick="addxqlc()"<br> style="float:right;font-size:16px;font-style:oblique;padding-right:20px">操作说明</a><br> </div><br> <form id="addForm" action="<c:url value='/xq.do?action=doAddxq'/>&quot;<br> method=&quot;post&quot; id=&quot;addForm&quot; name=&quot;addForm&quot;&gt;<br> <input type="hidden" id="fbfs" name="fbfs" value="1" /><br> <table cellpadding="0" cellspacing="0" class="cx_table"><br> <tr><br> <th><b><em></b>需求名称:</th><br> <td height="25" align="left" bgcolor="#FFFFFF" colspan="3"><input<br> type="text" id="xqName" name="xqName" value="" maxlength="50" /></td><br> </tr><br> <tr><br> <th><b></em></b>付款方式:</th><br> <td height="25" align="left" bgcolor="#FFFFFF"><select<br> id="fkfs" name="fkfs" onchange="checkfkfs()"><br> <option value="1">具体价格</option><br> <option value="2">面议</option><br> </select></td><br> <th><b><em></b>预算价格(元):</th><br> <td height="25" align="left" bgcolor="#FFFFFF"><input<br> type="text" id="price" name="price" value=""<br> onkeyup="value=value.replace(/[^\d]/g,'') "<br> onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" /><br> </td><br> </tr><br> <tr><br> <th><b></em></b>服务所属大类:</th><br> <td height="25" align="left" bgcolor="#FFFFFF"><select<br> name="fwdl" id="fwdl" class="select_field" onchange="findztype()"><br> <c:forEach items="${fwdl}" var="domain"><br> <option value="${domain.id }" title="${domain.name }"><br> ${domain.name }</option><br> <a href="/c:forEach">/c:forEach</a><br> </select></td><br> <th><b><em></b>服务所属小类:</th><br> <td height="25" align="left" colspan="3" bgcolor="#FFFFFF"><select<br> name="fwxl" id="fwxl" class="select_field"><br> <c:forEach items="${fwxl}" var="domain"><br> <option value="${domain.id }" title="${domain.name }"><br> ${domain.name }</option><br> <a href="/c:forEach">/c:forEach</a><br> </select></td><br> </tr><br> <tr><br> <th><b></em></b>需求内容:</th><br> <td height="25" align="left" colspan="3" bgcolor="#FFFFFF"><script<br> type="text/plain" id="myEditor" name="contents"> type="text/javascript"><br> var Editor= new UE.ui.Editor({initialFrameWidth:&#39;600&#39;,initialFrameHeight:&#39;200&#39;,toolbars:[[&#39;fullscreen&#39;, &#39;undo&#39;, &#39;redo&#39;, &#39;|&#39;,<br> &#39;bold&#39;, &#39;italic&#39;, &#39;underline&#39;, &#39;fontborder&#39;, &#39;strikethrough&#39;, &#39;superscript&#39;, &#39;subscript&#39;, &#39;removeformat&#39;, &#39;formatmatch&#39;, &#39;autotypeset&#39;, &#39;blockquote&#39;, &#39;pasteplain&#39;, &#39;|&#39;, &#39;forecolor&#39;, &#39;backcolor&#39;, &#39;insertorderedlist&#39;, &#39;insertunorderedlist&#39;, &#39;selectall&#39;, &#39;cleardoc&#39;, &#39;|&#39;,<br> &#39;rowspacingtop&#39;, &#39;rowspacingbottom&#39;, &#39;lineheight&#39;, &#39;|&#39;,<br> &#39;customstyle&#39;, &#39;paragraph&#39;, &#39;fontfamily&#39;, &#39;fontsize&#39;, &#39;|&#39;,<br> &#39;directionalityltr&#39;, &#39;directionalityrtl&#39;, &#39;indent&#39;, &#39;|&#39;,<br> &#39;justifyleft&#39;, &#39;justifycenter&#39;, &#39;justifyright&#39;, &#39;justifyjustify&#39;, &#39;|&#39;, &#39;touppercase&#39;, &#39;tolowercase&#39;, &#39;|&#39;,<br> &#39;link&#39;, &#39;unlink&#39;, &#39;anchor&#39;, &#39;|&#39;, &#39;imagenone&#39;, &#39;imageleft&#39;, &#39;imageright&#39;, &#39;imagecenter&#39;, &#39;|&#39;,<br> &#39;insertimage&#39;, &#39;emotion&#39;, &#39;insertvideo&#39;, &#39;music&#39;, &#39;attachment&#39;, &#39;map&#39;, &#39;gmap&#39;, &#39;insertframe&#39;,&#39;pagebreak&#39;, &#39;template&#39;, &#39;background&#39;, &#39;|&#39;,<br> &#39;horizontal&#39;, &#39;date&#39;, &#39;time&#39;, &#39;spechars&#39;, &#39;snapscreen&#39;, &#39;wordimage&#39;, &#39;|&#39;,<br> &#39;inserttable&#39;, &#39;deletetable&#39;, &#39;insertparagraphbeforetable&#39;, &#39;insertrow&#39;, &#39;deleterow&#39;, &#39;insertcol&#39;, &#39;deletecol&#39;, &#39;mergecells&#39;, &#39;mergeright&#39;, &#39;mergedown&#39;, &#39;splittocells&#39;, &#39;splittorows&#39;, &#39;splittocols&#39;, &#39;|&#39;,<br> &#39;print&#39;, &#39;preview&#39;, &#39;searchreplace&#39;, &#39;help&#39;]]<br> ,elementPathEnabled : false});<br> Editor.render(&#39;myEditor&#39;);<br>


*推荐企业:
readonly="readonly" class="cl_textarea_small" name="xqName"
id="xqName" width="100"> name=inputboxbt value=请选择 onclick="openwindow();">



type="button" value="保 存" id="saveBtn" class="btn_bg"
onclick="addxm('1');" /> class="btn_bg" /> onclick="closeYmtPage();" />








  • 当前位置:

  • 添加需求->推荐企业选择->





<!--检索区域开始 --
<!--检索区域结束 -->
<!--按钮区域开始 -->

请选择企业:



<!--按钮区域结束 -->



<!--

-->









class="grid_dark"/c:if
class="grid_dark"/c:if
id="${domain1.id }">




/c:forEach
onclick="checkOrCancel(this);" class="textCursor" />
序号 企业名称
name="ifCheck" style="cursor: pointer;" id="ifCheck"
onClick="result(this.form)" /> type="hidden" name="qymc.id" value="" />
${status.count } ${domain1.qymc }

            </div>

        </div>
    </div>
</div>

  • 写回答

6条回答 默认 最新

  • 另一花生 2015-07-23 16:26
    关注

    直接弹窗,里面没有内容,只是前台js的调用,如果弹窗里面有数据,就要调用action了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?