modal popup does not work on button click in tab container - modal-dialog

I have a page which contains multiple tab. I need to have one modal popup to be popped up to show different message. I tried in the following ways but failed.
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="userUpdatePanel" runat="server">
<ContentTemplate>
<center style="margin-top: 0px">
<ajaxToolkit:TabContainer ID="TabContainer1" AutoPostBack="true" runat="server" ActiveTabIndex="0">
<cc1:TabPanel runat="server" HeaderText="Country" ID="TabPanel1">
<ContentTemplate>
<center>
<input type="hidden" id="hidUserID" runat="server" value="0" />
<table class="contentTable">
<tr class="contentRow">
<td class="columnName">
Action
</td>
<td class="columnData">
<asp:RadioButtonList ID="rbtnCountryAddorModify" RepeatDirection="Horizontal" AutoPostBack="true"
runat="server" >
<asp:ListItem Value="Add" Selected="True">Add</asp:ListItem>
<asp:ListItem Value="Modify">Modify</asp:ListItem>
</asp:RadioButtonList>
</td>
<td></td>
</tr>
<tr class="contentRow">
<td class="columnName">
Country
</td>
<td class="columnData">
<ajaxToolkit:ComboBox ID="cmbCountry" runat="server" AutoPostBack="true"
CssClass="AjaxToolkitStyle" DropDownStyle="DropDown" CausesValidation="True"
onselectedindexchanged="cmbCountry_SelectedIndexChanged">
<asp:ListItem Value="0">--Select--</asp:ListItem>
</ajaxToolkit:ComboBox>
</td>
<td></td>
</tr>
<tr class="alternateRow">
<td class="columnName">
New Country Name
</td>
<td class="columnData">
<asp:TextBox ID="txtCountryName" runat="server" Width="230px" ValidationGroup="user"></asp:TextBox>
</td>
<td></td>
</tr>
<tr class="contentRow">
<td class="buttonRow" colspan="2">
<asp:button ID="btnSaveCountry" runat="server" text="Submit" OnClick="btnSaveCountry_Click"
/>
<asp:Button ID="reset" runat="server" Text="reset" OnClick="reset_Click" />
<asp:Button ID="Button1" runat="server" Text="Hiden" />
</td>
</tr>
</table>
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none" >
<br />
<asp:Label ID="lblMsg" runat="server" Height="30px" ForeColor="red"></asp:Label>
<table style="width: 270px">
<tr>
<td >
</td>
<td>
<asp:Button ID="btnCancel" runat="server" Text="Ok" />
</tr>
</table>
</asp:Panel>
<cc1:ModalPopupExtender ID="ModalPopupExtenderMsg" runat="server"
TargetControlID="Button1"
PopupControlID="Panel1"
BackgroundCssClass="modalBackground"
DropShadow="true"
CancelControlID="btnCancel" >
</cc1:ModalPopupExtender>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel2" AutoPostBack="true" runat="server" HeaderText="Division">
<ContentTemplate>
<center>
<input type="hidden" id="Hidden1" runat="server" value="0" />
<table class="contentTable">
<tr class="contentRow">
<td class="columnName">
Action
</td>
<td class="columnData">
<asp:RadioButtonList ID="rbtnDivProvAddorModify" RepeatDirection="Horizontal" AutoPostBack="true"
runat="server" >
<asp:ListItem Value="Add" Selected="True">Add</asp:ListItem>
<asp:ListItem Value="Modify">Modify</asp:ListItem>
</asp:RadioButtonList>
</td>
<td></td>
</tr>
<tr class="contentRow">
<td class="columnName">
Country
</td>
<td class="columnData">
<ajaxToolkit:ComboBox ID="cmbCountryForDiv" runat="server" AutoPostBack="true"
CssClass="AjaxToolkitStyle" DropDownStyle="DropDown" CausesValidation="True"
onselectedindexchanged="cmbCountryForDiv_SelectedIndexChanged">
<asp:ListItem Value="0">--Select--</asp:ListItem>
</ajaxToolkit:ComboBox>
</td>
<td></td>
</tr>
<tr class="contentRow">
<td class="columnName">
Division/Province
</td>
<td class="columnData">
<ajaxToolkit:ComboBox ID="cmbDivision" runat="server" AutoPostBack="true"
CssClass="AjaxToolkitStyle" DropDownStyle="DropDown" CausesValidation="True"
onselectedindexchanged="cmbDivision_SelectedIndexChanged">
<asp:ListItem Value="0">--Select--</asp:ListItem>
</ajaxToolkit:ComboBox>
</td>
<td></td>
</tr>
<tr class="alternateRow">
<td class="columnName">
New Division/Province Name
</td>
<td class="columnData">
<asp:TextBox ID="txtDivProvince" runat="server" Width="230px" ValidationGroup="user"></asp:TextBox>
</td>
<td></td>
</tr>
<tr class="contentRow">
<td class="buttonRow" colspan="2">
<asp:button ID="btnSaveDivision" runat="server" text="Submit" OnClick="btnSaveDivision_Click"
/>
<asp:Button ID="Button3" runat="server" Text="reset" OnClick="reset_Click" />
</td>
</tr>
</table>
</ContentTemplate>
<cc1:TabPanel ID="TabPanel4" AutoPostBack="true" runat="server" HeaderText="Thana">
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel5" AutoPostBack="true" runat="server" HeaderText="Municipality">
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel6" AutoPostBack="true" runat="server" HeaderText="UPHeadQuarter">
</cc1:TabPanel>
</ajaxToolkit:TabContainer>
<asp:Button ID="Button4" runat="server" Text="pOPUp" onclick="Button4_Click" />
<asp:Button ID="Button2" runat="server" Visible="false" Text="Hidden" />
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
TargetControlID="Button2"
PopupControlID="Panel4"
BackgroundCssClass="modalBackground"
DropShadow="true"
CancelControlID="Button7" >
</cc1:ModalPopupExtender>
<asp:Panel ID="Panel4" runat="server" CssClass="modalPopup" Style="display: none" >
<br />
<asp:Label ID="Label3" runat="server" Height="30px" ForeColor="red"></asp:Label>
<table style="width: 270px">
<tr>
<td >
</td>
<td>
<asp:Button ID="Button7" runat="server" Text="Ok" />
</tr>
</table>
</asp:Panel>
</center>
</ContentTemplate>
</asp:UpdatePanel>
In .cs file I have the code as follows.
protected void showModalMsgBox(string msg,AjaxControlToolkit.ModalPopupExtender mdlPopupMsg) {
switch (msg)
{
case "success":
lblMsg.Text = "Data saved successfully.";
break;
default:
lblMsg.Text = "Data is not saved. Please contact with administrator.";
break;
}
//userUpdatePanel.Update();
mdlPopupMsg.Show();
}
protected void btnSaveDivision_Click(object sender, EventArgs e)
{
showModalMsgBox("Sample", ModalPopupExtenderMsg);
}
protected void btnSaveCountry_Click(object sender, EventArgs e)
{
showModalMsgBox("Sample", ModalPopupExtenderMsg);
}
It shows modal popup for country but not for division. But If I write
protected void btnSaveDivision_Click(object sender, EventArgs e)
{
showModalMsgBox("Sample", ModalPopupExtender1);
}
protected void btnSaveCountry_Click(object sender, EventArgs e)
{
showModalMsgBox("Sample", ModalPopupExtender1);
}
It shows modal popup neither for country nor for division. I need a common popup for each tab container. Can I do that? or what can I do here? Is there any body to help? Thanks.

Related

Posting form in JSoup doesn't produce any response

I'd like to automatically retrieve the results of searching for a Chinese character on this webpage. After inputting a character such as '馬' into the search field labelled '字形', submitting the form produces a form called 'HiddenFrom' as follows, the contents of which I'm aiming to output (which would look like the following):
<form Id="HiddenFrom" action="/yanbian/PageResult/PageResult" method="post" onclick="Sys.Mvc.AsyncForm.handleClick(this, new Sys.UI.DomEvent(event));" onsubmit="Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, httpMethod: 'Post', updateTargetId: 'PageResult', onSuccess: Function.createDelegate(this, Feedback) });"><input id="ZiOrder" name="ZiOrder" type="hidden" value="" />
<input id="EudcFontChar" name="EudcFontChar" type="hidden" value="馬" />
<input id="PageNo" name="PageNo" type="hidden" value="" />
<input id="Reference" name="Reference" type="hidden" value="" />
<input id="IsZiTou" name="IsZiTou" type="hidden" value="0" />
<table border="0" cellspacing="0" cellpadding="0" width="95%" id="yanbian_result">
<tr>
<td colspan="10" align="left">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="ZiList"><span id="StartOrder">6104</span></td>
<td><img src="/ImageText2/ShowImage.ashx?text=%e9%a6%ac&font=%e6%a8%99%e6%a5%b7%e9%ab%94&size=29&style=regular&color=%23000000" alt="&0.99AC;" class="charValue" style="vertical-align:text-bottom" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="10" align="right" class="Information">
共搜尋到17字,字形大小:<select name="ImageSize" id="ImageSize">
<option value="16">16</option>
<option value="20">20</option>
<option value="24">24</option>
<option value="28">28</option>
<option value="32">32</option>
<option value="36" selected="selected">36</option>
<option value="40">40</option>
<option value="44">44</option>
<option value="48">48</option>
<option value="54">54</option>
<option value="60">60</option>
<option value="66">66</option>
<option value="72">72</option>
</select>點
</td>
</tr>
<tr>
<td colspan="10" align="center" valign="top"> </td>
</tr>
<tr><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8d%b2&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E372;" class="charValue" style="vertical-align:text-bottom" /><br />鐵2.2(甲)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8d%b3&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E373;" class="charValue" style="vertical-align:text-bottom" /><br />乙9092(甲)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8e%82&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E382;" class="charValue" style="vertical-align:text-bottom" /><br />甲1286(甲)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8e%98&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E398;" class="charValue" style="vertical-align:text-bottom" /><br />林1.23.20(甲)<br /><td><td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%81&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E881;" class="charValue" style="vertical-align:text-bottom" /><br />戊寅作父丁方鼎(金)<br />商代晚期<td><tr>
<tr><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%8a&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E88A;" class="charValue" style="vertical-align:text-bottom" /><br />彔伯戈冬簋蓋(金)<br />西周中期<td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%b9&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8B9;" class="charValue" style="vertical-align:text-bottom" /><br />大𤔲馬簠(金)<br />春秋早期<td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%bd&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8BD;" class="charValue" style="vertical-align:text-bottom" /><br />伯亞臣𦉢(金)<br />春秋<td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%be&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8BE;" class="charValue" style="vertical-align:text-bottom" /><br />妾子𧊒壺(金)<br />戰國晚期<td><td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a3%80&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8C0;" class="charValue" style="vertical-align:text-bottom" /><br />燕侯載器(金)<br />戰國<td><tr>
<tr><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%86%bb&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E1BB;" class="charValue" style="vertical-align:text-bottom" /><br />曾150(楚)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%85%ab&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E16B;" class="charValue" style="vertical-align:text-bottom" /><br />包2.30(楚)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%85%af&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E16F;" class="charValue" style="vertical-align:text-bottom" /><br />包2.103(楚)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a0%9a&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.E81A;" class="charValue" style="vertical-align:text-bottom" /><br />說文古文<br /><td><td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a0%9b&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.E81B;" class="charValue" style="vertical-align:text-bottom" /><br />說文籀文<br /><td><tr>
<tr><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%e9%a6%ac&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.99AC;" class="charValue" style="vertical-align:text-bottom" /><br />說文‧馬部<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%aa%8d&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%a7%a6%e7%b3%bb%e7%b0%a1%e7%89%98%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%80&size=36&style=regular&color=%23000000" alt="&71.EA8D;" class="charValue" style="vertical-align:text-bottom" /><br />睡.雜26(秦)<br /><td><td align="center" class="VariantListA"> <td><td align="center" class="VariantListA"> <td><td align="center" class="VariantListB"> <td></tr>
<tr>
<td colspan="10" align="center" valign="top" style="border-style: solid; border-width: 1px 0px 0px 0px; border-color: #808080"> <p class="RemindMessage">(點選字形可取得字形編輯資訊)</p></td>
</tr>
<tr>
<td colspan="10" align="center" valign="top"> </td>
</tr>
</table>
</form>
<p class="MessageTitle" style="width: 80px">漢語大字典</p>
<dl style="width: 95%" class="control">
<dd class="size">《說文》:“馬,怒也;武也。象馬頭髦尾四足之形。<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom" />,古文。<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom" />,籀文馬與<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom" />同,有髦。”</dd>
</dl>
<dl style="width: 95%" class="control">
<dd style="text-align: right">字體:<a id="smallSize" class="size">小</a>.<a id="middleSize" class="size">中</a>.<a id="largeSize" class="size">大</a></dd>
</dl>
<p class="MessageTitle" style="width: 64px">相關連結</p>
<ul style="width: 95%">
<li>小學堂異體字表、小篆、金文、甲骨文、楚系簡帛文字、秦系簡牘文字、傳抄古文字</li>
<li>小學堂上古音、中古音、官話、晉語、吳語、贛語、湘語、閩語、粵語、平話、客語、其他土話</li>
<li>小學堂韻書集成、廣韻、集韻、附釋文互註禮部韻略、增修互注禮部韻略、中原音韻、中州音韻、洪武正韻</li>
<li>國際電腦漢字與異體字知識庫(含漢語大字典釋義)</li>
<li>教育部異體字字典</li>
<li>開放康熙字典</li>
<li>遠流活用中文大辭典</li>
</ul>
<p class="MessageTitle" style="width: 64px">相關索引</p>
<ul style="width: 95%">
<li>漢語大字典(遠東圖書公司),冊.頁.字:7.4539.1</li>
<li>漢語大字典(建宏出版社),頁.字:1886.17</li>
<li>康熙字典(中華書局),頁.字:1433.01</li>
<li>中文大辭典(中華學術院),冊.編號:10.45550</li>
<li>說文解字(中華書局),卷.部首:10上.馬部</li>
<li>說文解字詁林正補合編(鼎文書局),冊.頁:8.383</li>
<li>說文新證(藝文印書館),冊頁:下98</li>
<li>說文新證(福建人民出版社),頁:770</li>
<li>金文編(中華書局),頁.行:675.3</li>
<li>金文詁林(香港中文大學),卷.頁:10.1</li>
<li>金文詁林補(中央研究院),冊.卷.頁:5.10.3073</li>
<li>殷周金文集成引得(中華書局),字號.頁:3538.1060</li>
<li>新金文編(作家出版社),冊頁:中1387</li>
<li>甲骨文編(中華書局),頁.行:397.3</li>
<li>甲骨文字詁林(吉林大學),冊.頁:2.1589</li>
<li>甲骨文字集釋(中央研究院),卷.頁:10.3031</li>
<li>殷墟甲骨刻辭類纂(吉林大學),冊頁:中624</li>
<li>新甲骨文編(福建人民出版社),頁.行:539.3</li>
<li>甲骨文字編(中華書局),字號.冊頁:1928.中573</li>
<li>楚系簡帛文字編(增訂本)(湖北教育出版社),頁.行:853.2</li>
<li>睡虎地秦簡文字編(文物出版社),頁.行:153.2</li>
<li>秦簡牘文字編(福建人民出版社),頁:289</li>
<li>戰國古文字典:戰國古文聲系(中華書局),冊頁:上605</li>
<li>傳抄古文字編(綫裝書局),冊頁.行:下963.1</li>
</ul>
... However, my program only outputs the contents of the default landing page, and thus contains no mention of that form:
<td id="PageResult" align="left" valign="top" style="margin: 0px;">
<div style="width: 95%"></div>
<div id="Index">
<p class="MessageTitle" style="width: 64px">最新消息</p>
<ul style="width: 95%">
<li class="MessageList">小學堂字形演變資料庫由行政院國家科學委員會經費補助,中央研究院歷史語言研究所和資訊科學研究所共同開發,歡迎大家使用!(2013/09/25)</li>
<li class="MessageList">本資料庫共收錄字頭13098個,字形28321個。(2016/3/23)</li>
</ul>
<p class="MessageTitle" style="width: 64px">快速入門</p>
<ul style="width: 95%">
<li>適用瀏覽器:IE 8.0 以上版本、Firefox 4 以上版本、Google Chrome、Safari 5 以上版本</li>
<li>檢索條件的文字方塊內按<span class="MessagePoint">F1</span>鍵,可快速取得操作指引。</li>
<li>小學堂字形演變資料庫使用簡介。</li>
</ul>
</div> </td>
The code I've produced, based on what I can gather from other StackOverflow posts, is as follows. It successfully connects to the page, but either the post fails or the results aren't being read correctly:
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.FormElement;
import org.jsoup.select.Elements;
import java.io.IOException;
public class ImgURLExtractor {
public void sendPostAndPrintResponse(String kanjiToSearch) throws IOException {
Document doc = Jsoup.connect("http://xiaoxue.iis.sinica.edu.tw/yanbian")
.data("ZiOrder", "") // The 'ZiOrder' form field can be left blank.
.data("EudcFontChar", kanjiToSearch)
// 'EudcFontChar' is the id of the search field I want to enter my query '馬' into.
.method(Connection.Method.POST)
.post();
Elements target = doc.select("#PageResult");
// The table row '#PageResult' should contain the 'HiddenFrom' form.
System.out.println(target.toString());
}
public static void main(String[] args) throws IOException {
ImgURLExtractor example = new ImgURLExtractor();
example.sendPostAndPrintResponse("馬");
}
}
Thanks if anyone can help.
Looking at the Network tab of Chrome's Developer Tools (or Firefox) you can examine the exact request that is sent to the server. The response from the server is what you are looking for.
Here is a snapshot of the Dev Tools: (you can see the POST request URL and also the data being sent)
So all you need to do is to imitate sending this request to the server and get what you need in the response.
Here is a sample Java code for sending a POST request using OkHttp library:
package com.sample;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class PostExample {
private static final MediaType FORM = MediaType.parse("application/x-www-form-urlencoded; charset=UTF-8");
private OkHttpClient client = new OkHttpClient();
private String post(String url, String formData) throws IOException {
RequestBody body = RequestBody.create(FORM, formData);
Request request = new Request.Builder().url(url).post(body).build();
Response response = client.newCall(request).execute();
return response.body().string();
}
private String createFormData(String ziOrder, String eudcFontChar) throws UnsupportedEncodingException {
return "ZiOrder=" + URLEncoder.encode(ziOrder, "UTF-8") +
"&EudcFontChar=" + URLEncoder.encode(eudcFontChar, "UTF-8") +
"&ImageSize=36&X-Requested-With=XMLHttpRequest";
}
public static void main(String[] args) throws IOException {
PostExample example = new PostExample();
String formData = example.createFormData("", THE_CHINESE_CHAR);
String response = example.post("http://xiaoxue.iis.sinica.edu.tw/yanbian/PageResult/PageResult", formData);
System.out.println(response);
}
}
Running this code will return the HiddenFrom:
<form Id="HiddenFrom"...
Thanks to Navid (above) putting me back on the right track with his OkHttp code (showing that I should point to the PageResult/PageResult directory instead of the root), and finding an example usage of the 'org.jsoup.Connection.Response' class, I was able to also get the program working in JSoup. Here it is for reference:
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.Connection.Response;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.FormElement;
import org.jsoup.select.Elements;
import java.io.IOException;
public class ImgURLExtractor {
public void sendPostAndPrintResponse(String kanjiToSearch) throws IOException {
Response response = Jsoup.connect("http://xiaoxue.iis.sinica.edu.tw/yanbian/PageResult/PageResult")
.data("ZiOrder", "")
.data("EudcFontChar", kanjiToSearch)
.data("ImageSize", "36")
.data("X-Requested-With", "XMLHTTPRequest")
.method(Connection.Method.POST)
.timeout(10000) // This website can actually take a while to respond
.execute();
System.out.println(response.parse());
// Payload should include: /ImageText2/ShowImage.ashx?text=&font=中研院甲骨文重文三&size=36&style=regular&color=%23000000
}
public static void main(String[] args) throws IOException {
ImgURLExtractor example = new ImgURLExtractor();
example.sendPostAndPrintResponse("馬");
}
}
It returns:
<html>
<head></head>
<body>
<form id="HiddenFrom" action="/yanbian/PageResult/PageResult" method="post" onclick="Sys.Mvc.AsyncForm.handleClick(this, new Sys.UI.DomEvent(event));" onsubmit="Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, httpMethod: 'Post', updateTargetId: 'PageResult', onSuccess: Function.createDelegate(this, Feedback) });">
<input id="ZiOrder" name="ZiOrder" type="hidden" value="">
<input id="EudcFontChar" name="EudcFontChar" type="hidden" value="馬">
<input id="PageNo" name="PageNo" type="hidden" value="">
<input id="Reference" name="Reference" type="hidden" value="">
<input id="IsZiTou" name="IsZiTou" type="hidden" value="0">
<table border="0" cellspacing="0" cellpadding="0" width="95%" id="yanbian_result">
<tbody>
<tr>
<td colspan="10" align="left">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="ZiList"><span id="StartOrder">6104</span></td>
<td><img src="/ImageText2/ShowImage.ashx?text=%e9%a6%ac&font=%e6%a8%99%e6%a5%b7%e9%ab%94&size=29&style=regular&color=%23000000" alt="&0.99AC;" class="charValue" style="vertical-align:text-bottom"></td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td colspan="10" align="right" class="Information"> 共搜尋到17字,字形大小:<select name="ImageSize" id="ImageSize"> <option value="16">16</option> <option value="20">20</option> <option value="24">24</option> <option value="28">28</option> <option value="32">32</option> <option value="36" selected>36</option> <option value="40">40</option> <option value="44">44</option> <option value="48">48</option> <option value="54">54</option> <option value="60">60</option> <option value="66">66</option> <option value="72">72</option> </select>點 </td>
</tr>
<tr>
<td colspan="10" align="center" valign="top"> </td>
</tr>
<tr>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8d%b2&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E372;" class="charValue" style="vertical-align:text-bottom"><br>鐵2.2(甲)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8d%b3&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E373;" class="charValue" style="vertical-align:text-bottom"><br>乙9092(甲)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8e%82&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E382;" class="charValue" style="vertical-align:text-bottom"><br>甲1286(甲)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8e%98&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E398;" class="charValue" style="vertical-align:text-bottom"><br>林1.23.20(甲)<br></td>
<td></td>
<td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%81&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E881;" class="charValue" style="vertical-align:text-bottom"><br>戊寅作父丁方鼎(金)<br>商代晚期</td>
<td></td>
</tr>
<tr>
</tr>
<tr>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%8a&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E88A;" class="charValue" style="vertical-align:text-bottom"><br>彔伯戈冬簋蓋(金)<br>西周中期</td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%b9&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8B9;" class="charValue" style="vertical-align:text-bottom"><br>大𤔲馬簠(金)<br>春秋早期</td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%bd&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8BD;" class="charValue" style="vertical-align:text-bottom"><br>伯亞臣𦉢(金)<br>春秋</td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%be&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8BE;" class="charValue" style="vertical-align:text-bottom"><br>妾子𧊒壺(金)<br>戰國晚期</td>
<td></td>
<td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a3%80&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8C0;" class="charValue" style="vertical-align:text-bottom"><br>燕侯載器(金)<br>戰國</td>
<td></td>
</tr>
<tr>
</tr>
<tr>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%86%bb&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E1BB;" class="charValue" style="vertical-align:text-bottom"><br>曾150(楚)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%85%ab&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E16B;" class="charValue" style="vertical-align:text-bottom"><br>包2.30(楚)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%85%af&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E16F;" class="charValue" style="vertical-align:text-bottom"><br>包2.103(楚)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a0%9a&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.E81A;" class="charValue" style="vertical-align:text-bottom"><br>說文古文<br></td>
<td></td>
<td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a0%9b&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.E81B;" class="charValue" style="vertical-align:text-bottom"><br>說文籀文<br></td>
<td></td>
</tr>
<tr>
</tr>
<tr>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%e9%a6%ac&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.99AC;" class="charValue" style="vertical-align:text-bottom"><br>說文‧馬部<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%aa%8d&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%a7%a6%e7%b3%bb%e7%b0%a1%e7%89%98%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%80&size=36&style=regular&color=%23000000" alt="&71.EA8D;" class="charValue" style="vertical-align:text-bottom"><br>睡.雜26(秦)<br></td>
<td></td>
<td align="center" class="VariantListA"> </td>
<td></td>
<td align="center" class="VariantListA"> </td>
<td></td>
<td align="center" class="VariantListB"> </td>
<td></td>
</tr>
<tr>
<td colspan="10" align="center" valign="top" style="border-style: solid; border-width: 1px 0px 0px 0px; border-color: #808080"> <p class="RemindMessage">(點選字形可取得字形編輯資訊)</p></td>
</tr>
<tr>
<td colspan="10" align="center" valign="top"> </td>
</tr>
</tbody>
</table>
</form>
<p class="MessageTitle" style="width: 80px">漢語大字典</p>
<dl style="width: 95%" class="control">
<dd class="size">
《說文》:“馬,怒也;武也。象馬頭髦尾四足之形。
<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom">,古文。
<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom">,籀文馬與
<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom">同,有髦。”
</dd>
</dl>
<dl style="width: 95%" class="control">
<dd style="text-align: right">
字體:
<a id="smallSize" class="size">小</a>.
<a id="middleSize" class="size">中</a>.
<a id="largeSize" class="size">大</a>
</dd>
</dl>
<p class="MessageTitle" style="width: 64px">相關連結</p>
<ul style="width: 95%">
<li>小學堂異體字表、小篆、金文、甲骨文、楚系簡帛文字、秦系簡牘文字、傳抄古文字</li>
<li>小學堂上古音、中古音、官話、晉語、吳語、贛語、湘語、閩語、粵語、平話、客語、其他土話</li>
<li>小學堂韻書集成、廣韻、集韻、附釋文互註禮部韻略、增修互注禮部韻略、中原音韻、中州音韻、洪武正韻</li>
<li>國際電腦漢字與異體字知識庫(含漢語大字典釋義)</li>
<li>教育部異體字字典</li>
<li>開放康熙字典</li>
<li>遠流活用中文大辭典</li>
</ul>
<p class="MessageTitle" style="width: 64px">相關索引</p>
<ul style="width: 95%">
<li>漢語大字典(遠東圖書公司),冊.頁.字:7.4539.1</li>
<li>漢語大字典(建宏出版社),頁.字:1886.17</li>
<li>康熙字典(中華書局),頁.字:1433.01</li>
<li>中文大辭典(中華學術院),冊.編號:10.45550</li>
<li>說文解字(中華書局),卷.部首:10上.馬部</li>
<li>說文解字詁林正補合編(鼎文書局),冊.頁:8.383</li>
<li>說文新證(藝文印書館),冊頁:下98</li>
<li>說文新證(福建人民出版社),頁:770</li>
<li>金文編(中華書局),頁.行:675.3</li>
<li>金文詁林(香港中文大學),卷.頁:10.1</li>
<li>金文詁林補(中央研究院),冊.卷.頁:5.10.3073</li>
<li>殷周金文集成引得(中華書局),字號.頁:3538.1060</li>
<li>新金文編(作家出版社),冊頁:中1387</li>
<li>甲骨文編(中華書局),頁.行:397.3</li>
<li>甲骨文字詁林(吉林大學),冊.頁:2.1589</li>
<li>甲骨文字集釋(中央研究院),卷.頁:10.3031</li>
<li>殷墟甲骨刻辭類纂(吉林大學),冊頁:中624</li>
<li>新甲骨文編(福建人民出版社),頁.行:539.3</li>
<li>甲骨文字編(中華書局),字號.冊頁:1928.中573</li>
<li>楚系簡帛文字編(增訂本)(湖北教育出版社),頁.行:853.2</li>
<li>睡虎地秦簡文字編(文物出版社),頁.行:153.2</li>
<li>秦簡牘文字編(福建人民出版社),頁:289</li>
<li>戰國古文字典:戰國古文聲系(中華書局),冊頁:上605</li>
<li>傳抄古文字編(綫裝書局),冊頁.行:下963.1</li>
</ul>
</body>
</html>
Process finished with exit code 0

Jenkins Email template not working

I am trying to customize jenkins email template by adding jelly script. The script is working fine , but i am not getting the colour balls in mail, the balls are greyed out.
Below is the script. Can anyone please assist what changes needs to be done to the script so that colour balls will appear in jenkins emails.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<STYLE>
BODY, TABLE, TD, TH, P {
font-family:Verdana,Helvetica,sans serif;
font-size:11px;
color:black;
}
h1 { color:black; }
h2 { color:black; }
h3 { color:black; }
TD.bg1 { color:white; background-color:#0000C0; font-size:120% }
TD.bg2 { color:white; background-color:#4040FF; font-size:110% }
TD.bg3 { color:white; background-color:#8080FF; }
TD.test_passed { color:blue; }
TD.test_failed { color:red; }
TD.console { font-family:Courier New; }
</STYLE>
<BODY>
<j:set var="spc" value="&nbsp;&nbsp;" />
<!-- GENERAL INFO -->
<TABLE>
<TR><TD align="right">
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/blue.gif" />
</j:when>
<j:when test="${build.result=='FAILURE'}">
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/red.gif" />
</j:when>
<j:otherwise>
<IMG SRC="${rooturl}static/e59dfe28/images/32x32/yellow.gif" />
</j:otherwise>
</j:choose>
</TD><TD valign="center"><B style="font-size: 200%;">BUILD ${build.result}</B></TD></TR>
<TR><TD>Build URL</TD><TD>${rooturl}${build.url}</TD></TR>
<TR><TD>Project:</TD><TD>${project.name}</TD></TR>
<TR><TD>Date of build:</TD><TD>${it.timestampString}</TD></TR>
<TR><TD>Build duration:</TD><TD>${build.durationString}</TD></TR>
</TABLE>
<BR/>
<!-- CHANGE SET -->
<j:set var="changeSet" value="${build.changeSet}" />
<j:if test="${changeSet!=null}">
<j:set var="hadChanges" value="false" />
<TABLE width="100%">
<TR><TD class="bg1" colspan="2"><B>CHANGES</B></TD></TR>
<j:forEach var="cs" items="${changeSet}" varStatus="loop">
<j:set var="hadChanges" value="true" />
<j:set var="aUser" value="${cs.hudsonUser}"/>
<TR>
<TD colspan="2" class="bg2">${spc}Revision <B>${cs.commitId?:cs.revision?:cs.changeNumber}</B> by
<B>${aUser!=null?aUser.displayName:cs.author.displayName}: </B>
<B>(${cs.msgAnnotated})</B>
</TD>
</TR>
<j:forEach var="p" items="${cs.affectedFiles}">
<TR>
<TD width="10%">${spc}${p.editType.name}</TD>
<TD>${p.path}</TD>
</TR>
</j:forEach>
</j:forEach>
<j:if test="${!hadChanges}">
<TR><TD colspan="2">No Changes</TD></TR>
</j:if>
</TABLE>
<BR/>
</j:if>
<!-- ARTIFACTS -->
<j:set var="artifacts" value="${build.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<TABLE width="100%">
<TR><TD class="bg1"><B>BUILD ARTIFACTS</B></TD></TR>
<TR>
<TD>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</TD>
</TR>
</TABLE>
<BR/>
</j:if>
<!-- MAVEN ARTIFACTS -->
<j:set var="mbuilds" value="${build.moduleBuilds}" />
<j:if test="${mbuilds!=null}">
<TABLE width="100%">
<TR><TD class="bg1"><B>BUILD ARTIFACTS</B></TD></TR>
<j:forEach var="m" items="${mbuilds}">
<TR><TD class="bg2"><B>${m.key.displayName}</B></TD></TR>
<j:forEach var="mvnbld" items="${m.value}">
<j:set var="artifacts" value="${mvnbld.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<TR>
<TD>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</TD>
</TR>
</j:if>
</j:forEach>
</j:forEach>
</TABLE>
<BR/>
</j:if>
<!-- JUnit TEMPLATE -->
<j:set var="junitResultList" value="${it.JUnitTestResult}" />
<j:if test="${junitResultList.isEmpty()!=true}">
<TABLE width="100%">
<TR><TD class="bg1" colspan="2"><B>JUnit Tests</B></TD></TR>
<j:forEach var="junitResult" items="${it.JUnitTestResult}">
<j:forEach var="packageResult" items="${junitResult.getChildren()}">
<TR><TD class="bg2" colspan="2"> Name: ${packageResult.getName()} Failed: ${packageResult.getFailCount()} test(s), Passed: ${packageResult.getPassCount()} test(s), Skipped: ${packageResult.getSkipCount()} test(s), Total: ${packageResult.getPassCount()+packageResult.getFailCount()+packageResult.getSkipCount()} test(s)</TD></TR>
<j:forEach var="failed_test" items="${packageResult.getFailedTests()}">
<TR bgcolor="white"><TD class="test_failed" colspan="2"><B><li>Failed: ${failed_test.getFullName()} </li></B></TD></TR>
</j:forEach>
</j:forEach>
</j:forEach>
</TABLE>
<BR/>
</j:if>
<!-- COBERTURA TEMPLATE -->
<j:set var="coberturaAction" value="${it.coberturaAction}" />
<j:if test="${coberturaAction!=null}">
<j:set var="coberturaResult" value="${coberturaAction.result}" />
<j:if test="${coberturaResult!=null}">
<table width="100%"><TD class="bg1" colspan="2"><B>Cobertura Report</B></TD></table>
<table width="100%"><TD class="bg2" colspan="2"><B>Project Coverage Summary</B></TD></table>
<table border="1px" class="pane">
<tr>
<td>Name</td>
<j:forEach var="metric" items="${coberturaResult.metrics}">
<td>${metric.name}</td>
</j:forEach>
</tr>
<tr>
<td>${coberturaResult.name}</td>
<j:forEach var="metric" items="${coberturaResult.metrics}">
<td data="${coberturaResult.getCoverage(metric).percentageFloat}">${coberturaResult.getCoverage(metric).percentage}%
(${coberturaResult.getCoverage(metric)})
</td>
</j:forEach>
</tr>
</table>
<j:if test="${coberturaResult.sourceCodeLevel}">
<h2>Source</h2>
<j:choose>
<j:when test="${coberturaResult.sourceFileAvailable}">
<div style="overflow-x:scroll;">
<table class="source">
<thead>
<tr>
<th colspan="3">${coberturaResult.relativeSourcePath}</th>
</tr>
</thead>
${coberturaResult.sourceFileContent}
</table>
</div>
</j:when>
<j:otherwise>
<p>
<i>Source code is unavailable</i>
</p>
</j:otherwise>
</j:choose>
</j:if>
<j:forEach var="element" items="${coberturaResult.childElements}">
<j:set var="childMetrics" value="${coberturaResult.getChildMetrics(element)}"/>
<table width="100%"><TD class="bg2" colspan="2">Coverage Breakdown by ${element.displayName}</TD></table>
<table border="1px" class="pane sortable">
<tr>
<td>Name</td>
<j:forEach var="metric" items="${childMetrics}">
<td>${metric.name}</td>
</j:forEach>
</tr>
<j:forEach var="c" items="${coberturaResult.children}">
<j:set var="child" value="${coberturaResult.getChild(c)}"/>
<tr>
<td>
${child.xmlTransform(child.name)}
</td>
<j:forEach var="metric" items="${childMetrics}">
<j:set var="childResult" value="${child.getCoverage(metric)}"/>
<j:choose>
<j:when test="${childResult!=null}">
<td data="${childResult.percentageFloat}">${childResult.percentage}%
(${childResult})
</td>
</j:when>
<j:otherwise>
<td data="101">N/A</td>
</j:otherwise>
</j:choose>
</j:forEach>
</tr>
</j:forEach>
</table>
</j:forEach>
</j:if>
<BR/>
</j:if>
<!-- CONSOLE OUTPUT -->
<j:getStatic var="resultFailure" field="FAILURE" className="hudson.model.Result"/>
<j:if test="${build.result==resultFailure}">
<TABLE width="100%" cellpadding="0" cellspacing="0">
<TR><TD class="bg1"><B>CONSOLE OUTPUT</B></TD></TR>
<j:forEach var="line" items="${build.getLog(100)}"><TR><TD class="console">${line}</TD></TR></j:forEach>
</TABLE>
<BR/>
</j:if>
</BODY>
</j:jelly>
change the img src to a website address..something like :
img src="https://raw.githubusercontent.com/jenkinsci/jenkins/master/war/src/main/webapp/images/32x32/green.gif"

Form has Disabled Inputs, How to make Processing Page not try to process disabled fields?

I have a form where I disable the Shipping address when they click the "Same as Billing address" checkbox via JQuery.
When the form is submitted, the disabled fields (shipping) obviously do not pass any data but my processing form is saying that those specific fields are undefined.
How can I make the processing form not look for the values of the disabled fields (shipping), if they are disabled?
HERE IS THE PROCESSING FORM:
<cfset orderno = #numberFormat(randrange(00001,99999), "00000")#>
<cfmail to="xxx" from="xxx" subject="xxxx ORDER No. #orderno#" server="xxx" username="xx" password="xxx" type="html">
<img src="http://www.mmprint.com/index_files/maillogo.jpg" width="500" height="85" /> <br /><br /> <font face="Arial" size="+3"><strong>NEW LIVE JOB - <font color="##FF0000">CMS-1500 BLANK </font> Form Order No. <cfoutput>#orderno#</cfoutput> </strong>
<table border="1" bordercolor="##660000" cellpadding="2" cellspacing="0">
<tr>
<td colspan="2"><h2>CMS-1500 Order Information:</h2></td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Quantity:</td><td align="left" valign="top">#form.qty#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Type:</td><td align="left" valign="top">#form.cctype#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">CC Number:</td><td align="left" valign="top">#form.ccnumber#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">CC Month:</td><td align="left" valign="top">#form.ccmonth#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">CC Year:</td><td align="left" valign="top">#form.ccyear#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">CSV:</td><td align="left" valign="top">#form.csv#</td>
</tr>
<!-- Billing Info -->
<tr>
<td><h2>Billing Information:</h2></td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Company Name:</td><td align="left" valign="top">#form.bconame#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">First Name:</td><td align="left" valign="top">#form.bfname#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Last Name:</td><td align="left" valign="top">#form.blname#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Address:</td><td align="left" valign="top">#form.baddress#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Address:</td><td align="left" valign="top">#form.baddress2#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Address:</td><td align="left" valign="top">#form.bcity#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Address:</td><td align="left" valign="top">#form.bstate#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Address:</td><td align="left" valign="top">#form.bzip#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Email:</td><td align="left" valign="top">#form.email#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Comments:</td><td align="left" valign="top">#form.comments#</td>
</tr>
</table>
<br />
<br />
<!-- SHIPPING INFO -->
<table border="1" bordercolor="##660000" cellpadding="2" cellspacing="0">
<tr>
<td><h2>Shipping Information:</h2></td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Company Name:</td><td align="left" valign="top">#form.coname#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">First Name:</td><td align="left" valign="top">#form.fname#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Last Name:</td><td align="left" valign="top">#form.lname#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Address:</td><td align="left" valign="top">#form.address#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Address 2:</td><td align="left" valign="top">#form.address2#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">City:</td><td align="left" valign="top">#form.city#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">State:</td><td align="left" valign="top">#form.state#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Zip:</td><td align="left" valign="top">#form.zip#</td>
</tr>
</table>
</font>
</cfmail>
<cfmail to="#form.email#" from="xxx" bcc="xxx" subject="Thank You for your order - No. #orderno#" server="xxx" username="xxx" password="xxx" type="html">
<p><img src="xxx" width="500" height="85" /></p>
<p><font face="Arial" size="+1"><strong><font color="##006600">Order Confirmation- </font>- No. <cfoutput>#orderno#</cfoutput> </strong>
</font></p>
<font face="Arial" size="1"><p>Your order for <cfoutput>#qty#</cfoutput>xxx has been successfully received.</p>
<p>If your order is received by 2PM (ET) they will ship the same day!</p>
<p>Questions or Comments? Please call us at 1-877-mmprint or 516-334-1603 or email info#mmprint.com </p></font>
<table border="1" bordercolor="##660000" cellpadding="2" cellspacing="0">
<tr>
<td><h2>Shipping Information:</h2></td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Company Name:</td><td align="left" valign="top">#form.coname#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">First Name:</td><td align="left" valign="top">#form.fname#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Last Name:</td><td align="left" valign="top">#form.lname#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Address:</td><td align="left" valign="top">#form.address#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Address 2:</td><td align="left" valign="top">#form.address2#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">City:</td><td align="left" valign="top">#form.city#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">State:</td><td align="left" valign="top">#form.state#</td>
</tr>
<tr>
<td bgcolor="##CCCCCC" align="left" valign="top">Zip:</td><td align="left" valign="top">#form.zip#</td>
</tr>
</table>
</cfmail>
<cflocation url="thanks.cfm?name=#form.bfname#" addtoken="no">
HERE IS THE FORM ITSELF:
<form action="process.cfm" id="blank-form" method="post" class="vertical">
<div class="col_4 ">
<fieldset>
<legend>Choose Your Quantity:</legend>
<p>
<select id="qty" name="qty" size="4" data-validation="required" data-validation-error-msg="Please Select a Quantity." >
<option value="100 Blank">100 - Blank CMS 1500 </option>
<option value="250 Blank">250 - Blank CMS 1500 </option>
<option value="500 Blank ">500 - Blank CMS 1500 </option>
<option value="1000 Blank">1000 - Blank CMS 1500 </option>
</select>
</p> <div style="font-size:0.7em; text-align:right;">*plus shipping and handling</div>
</fieldset>
<!-- CREDIT CARD -->
<fieldset>
<legend><i class="icon-lock"></i> Payment Information </legend>
<label for="cctype">Type</label>
<select id="cctype" name="cctype" data-validation="required">
<option value="VISA">VISA</option>
<option value="MC">Mastercard</option>
<option value="AMEX">AMEX</option>
<option value="DISC">Discover</option>
</select>
<label for="ccnumber">Credit Card Number</label>
<input type="text" id="ccnumber" name="ccnumber" data-validation="number" data-validation-error-msg="Please Enter a Valid Credit Card Number." >
<div class="col_5"> <label for="ccmonth">Expiration</label>
<select name="ccmonth" id="ccmonth" data-validation="required">
<option value = "1">January</option>
<option value = "2">February</option>
<option value = "3">March</option>
<option value = "4">April</option>
<option value = "5">May</option>
<option value = "6">June</option>
<option value = "7">July</option>
<option value = "8">August</option>
<option value = "9">September</option>
<option value = "10">October</option>
<option value = "11">November</option>
<option value = "12">December</option>
</select></div>
<div class="col_4"> <label for="ccyear">Year</label>
<select name="ccyear" id="ccyear" data-validation="required">
<option value = "2014" >2014</option>
<option value = "2015">2015</option>
<option value = "2016">2016</option>
<option value = "2017">2017</option>
<option value = "2018">2018</option>
<option value = "2019">2019</option>
<option value = "2020">2020</option>
</select></div>
<div class="col_3"><label for="csv" >CSV #</label>
<input type="text" name="csv" id="csv" data-validation="required" data-validation-error-msg=" "></div>
</fieldset>
<fieldset><legend>Email & Phone</legend>
<input type="text" placeholder="your#email.com" name="email" id="email" data-validation="email" data-validation-error-msg="Please enter a valid email where you can receive your order confirmation.">
<input type="text" placeholder="555-505-5050" name="phone" id="phone" data-validation="number" data-validation-error-msg="Please enter a phone number where we can contact you."></fieldset>
</div>
<div class="col_4">
<fieldset>
<legend>Billing Information</legend>
<p><input type="checkbox" id="sameasbilling"> Ship to Same As Billing Address</p>
<label for="bconame">Company Name</label>
<input type="text" id="bconame" name="bconame" minlength="2"/>
<label for="bfname">First Name</label>
<input type="text" id="bfname" name="bfname" minlength="2" data-validation="required"/>
<label for="blname">Last Name</label>
<input type="text" id="blname" name="blname" minlength="2" data-validation="required"/>
<label for="baddress">Address</label>
<input type="text" id="baddress" name="baddress" minlength="2" data-validation="required"/>
<label for="baddress2">Suite/Apt #</label>
<input type="text" id="baddress2" name="baddress2" />
<label for="bcity">City</label>
<input type="text" id="bcity" name="bcity" data-validation="required" />
<label for="bstate">State</label>
<input type="text" id="bstate" name="bstate" minlength="2" data-validation="required" />
<label for="bzip">Zip</label>
<input type="text" id="bzip" name="bzip" minlength="5" data-validation="required"/>
</fieldset>
</div>
<div class="col_4" id="shipping">
<fieldset>
<legend>Shipping Information</legend><br><br>
<label for="coname">Company Name</label>
<input type="text" id="coname" name="coname" minlength="2" />
<label for="fname">First Name</label>
<input type="text" id="fname" name="fname" minlength="2" data-validation="required"/>
<label for="lname">Last Name</label>
<input type="text" id="lname" name="lname" minlength="2" data-validation="required" />
<label for="address">Address</label>
<input type="text" id="address" name="address" minlength="2" data-validation="required"/>
<label for="address2">Suite/Apt #</label>
<input type="text" id="address2" name="address2" />
<label for="city">City</label>
<input type="text" id="city" name="city" data-validation="required"/>
<label for="state">State</label>
<input type="text" id="state" name="state" minlength="2" data-validation="required"/>
<label for="zip">Zip</label>
<input type="text" id="zip" name="zip" minlength="5" data-validation="required" />
</fieldset>
</div>
<div class="row">
<fieldset>
<legend>Comments | Special Instructions</legend>
<textarea id="comments" name="comments"></textarea>
<div class="right">
<button class="pop orange">Send the order!</button></div>
</form>
THE JQUERY:
<script>
$(document).ready(function() {
$('#sameasbilling').change(function(){
if ($('#sameasbilling').is(':checked')){
$('#shipping :input').addClass('disabled').prop('disabled', true).attr("value","Same As Billing");
} else {
$('#shipping :input').removeClass('disabled').prop('disabled', false).removeAttr("value");
}
});
$.validate();
})
</script>
I figured out that I can simply use
<cfparam name="form.name" default = "Default text">
to replace the missing fields when the form is processed.
I only accept this solution because my form is short. I'm sure there is a better way to do this for bigger forms that handle lots of data.
Hope this will help someone else.

Accordion inside another accordion

Iam using ajax accordion. Is it possible to add an ajax accordion inside another accordion.
I tried adding this, but the accordion inside is not loading(not getting displayed)
<ajax:Accordion ID="accordionCountry" HeaderCssClass="headerStyle marginUpDown" HeaderSelectedCssClass="headerSelectedStyle" ContentCssClass="contentBackground" runat="server" SelectedIndex="-1" FadeTransitions="true" SuppressHeaderPostbacks="true" TransitionDuration="250" FramesPerSecond="40" RequireOpenedPane="false" AutoSize="None">
<HeaderTemplate>
<asp:Panel ID="pnlShowCategory" runat="server" CssClass="cursorPointer categoryPanelBackground marginUpDown">
<table cellpadding="0" cellspacing="0" width="98%">
<tr>
<td align="left">
<asp:Label ID="lblCategoryName" runat="server" Text='<%# Eval("CategoryName") %>'
CssClass="paddingLeft"></asp:Label>
</td>
<td align="right">
<asp:Image ID="Image3" runat="server" ImageAlign="Right" Height="20px" CssClass="verticalAlignMiddle" />
<asp:HiddenField ID="hdnCategoryId" runat="server" Value='<%# Eval("CategoryId") %>' />
</td>
</tr>
</table>
</asp:Panel>
</HeaderTemplate>
<ContentTemplate>
<ajax:Accordion ID="accordionCountry1" HeaderCssClass="headerStyle marginUpDown" HeaderSelectedCssClass="headerSelectedStyle"
ContentCssClass="contentBackground" runat="server" SelectedIndex="-1" FadeTransitions="true"
SuppressHeaderPostbacks="true" TransitionDuration="250" FramesPerSecond="40"
RequireOpenedPane="false" AutoSize="None">
<HeaderTemplate>
</HeaderTemplate>
<ContentTemplate>
<asp:Panel ID="pnl" runat="server" CssClass="cursorPointer categoryPanelBackground marginUpDown">
<table cellpadding="0" cellspacing="0" width="98%">
<tr>
<td align="left">
<asp:Label ID="lblSubCategoryName" runat="server" Text='<%# Eval("SubCategoryName") %>'
CssClass="paddingLeft"></asp:Label>
</td>
<td align="right">
<asp:Image ID="Image3" runat="server" ImageAlign="Right" Height="20px" CssClass="verticalAlignMiddle" />
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
</ajax:Accordion>
</ContentTemplate>
</ajax:Accordion>
try to use jQuery for accordion, it's better, check below link out :
click run after you click the link below
(function($) {
var allPanels = $('.accordion .dd').hide();
$('.accordion .dt a').click(function() {
allPanels.slideUp();
$(this).parent().next().slideDown();
return false;
});
})(jQuery);
Check This

overlapping of panels (ascx) in IE7

I have the problem of panel overlapping in IE7 whereas the same code works in IE8.
Has anyone faced this kind of problem?
In the code below, i have a link button, on clicking this, the products frame would be displayed. But this overlaps with the "client products" :
<%# Control Language="C#" AutoEventWireup="true" CodeFile="ClientSummary.ascx.cs" Inherits="ClientSummary" %>
<%# Register Src="~/Controls/ClientSession/CounselorMenuFrame.ascx" TagName="CounselorMenuFrame" TagPrefix="UCC" %>
<%# Register Src="~/Controls/ClientSession/ProductsFrame.ascx" TagName="ProductsFrame" TagPrefix="UCC" %>
<%# Register Src="~/Controls/ClientSession/ProductDetailFrame.ascx" TagName="ProductDetailFrame" TagPrefix="UCC" %>
<%# Register Src="~/Controls/ClientSession/ClientDetailFrame.ascx" TagName="ClientDetailFrame" TagPrefix="UCC" %>
<asp:Panel ID="pnlClntSummary" runat="server" EnableViewState="true" >
<asp:Panel ID="pnlClientDetailFrame" runat="server" Style="width: 950px;" >
<UCC:ClientDetailFrame id="clientDetailFrame" runat="server" />
</asp:Panel>
<asp:Panel ID="pnlProductDetailFrame" runat="server" Style="width: 950px;" >
<UCC:ProductDetailFrame id="productDetailFrame" runat="server"/>
</asp:Panel>
<div id="slider" style="width:950px;">
asp:Panel ID="pnlProductsFrame" runat="server" Style="width: 950px;" >
<table style="width:900px;" >
<tr><td></td><td>
<asp:LinkButton Text="Client Information" ID="clientDetail" Font-Underline="true"
Font-Bold="true" Font-Names="Calibri" Font-Size="Medium" runat="server"
onclick="clientDetail_Click"/>
</td>
</tr>
<tr>
<td valign="top" style="float:left" align="left">
<div style="float:left;vertical-align:top;">
<div id="content" class="contentMenu">
<UCC:ProductsFrame id="productsFrame" runat="server" />
</div>
</div>
</td>
<td valign="top" style="width:900px;" align="left">
<div id="header1" style="float:left;position:relative;width:45px;">
<table border="0">
<tr>
<td valign="top" style="width:30px;"
onclick="verticalprocessClick(document.getElementById('header1'))">
<div style="padding: 2px; cursor: pointer; vertical-align: top;">
<div style="float: left; vertical-align: bottom;">
<table>
<tr onclick="ImageChangePFrame(imgPF)">
<td class="VerticalLine">
</td>
<td>
<img id="imgPF" src="../Images/icon_expand.png" alt="(Show Details...)"
onload="ProductFrameHide(this)"/>
<div id="divClientProducts" runat="server"
style="float:left;font-family:Calibri;top:1%;left:25%;position:relative;font-size:13px;
color:Gray;text-align:center;">
C<br />
L<br />
I<br />
E<br />
N<br />
T<br />
<br />
P<br />
R<br />
O<br />
D<br />
U<br />
C<br />
T<br />
S<br />
</div>
</td>
<td class="VerticalLine">
</td>
</tr>
</table>
</div>
</div>
</td>
<td>
</td>
</tr>
</table>
</div>
<div id="divTransactionDesktop" style="float:left;width:600px; height:100px;" >
<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<asp:PlaceHolder ID="MainFrameHolder" runat="server"></asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
<asp:HiddenField ID="hdnRowValue" runat ="server" Value="0" />
</div>
</td>
</tr>
</table>
</asp:Panel>
</div>
<asp:HiddenField ID="hdnLastFocus" runat="server" />
<asp:HiddenField ID="hdnKeyMapping" runat="server" />
</asp:Panel>
I found a solution for overlapping of panels in IE7. It was the height attribute which made a difference. Removing the height attribute or mentioning the exact value in pixels, solves this problem.