My engine is Aspx.
I am currently having trouble editing one of my columns(Question Answer) in my table because it has html tags in it. Is there a way I can decode only that specific row/column in the value area?
<form id="updateFreqQuestionsUser" action="<%=Url.Action("SaveFreqQuestionsUser","Prod")%>" method="post">
<table>
<tr>
<td colspan="3" class="tableHeader">Freq Questions User Details <input type ="hidden" value="<%=freqQuestionsUser.freqQuestionsUserId%>" name="freqQuestionsUserId"/> </td>
</tr>
<tr>
<td colspan="2" class="label">Question Description:</td>
<td class="content">
<input type="text" maxlength="2000" name="QuestionDescription" value="<%=freqQuestionsUser.questionDescription%>" />
</td>
</tr>
<tr>
<td colspan="2" class="label">QuestionAnswer:</td>
<td class="content">
<input type="text" maxlength="2000" name="QuestionAnswer" value="<%=freqQuestionsUser.questionAnswer%>" />
</td>
</tr>
<tr>
<td colspan="3" class="tableFooter">
<br />
<a id="freqQuestionsUserUpdateButton" href="#" class="regularButton">Save</a>
Cancel
</td>
</tr>
</table>
Yes, you can do this:
<input type="text" maxlength="2000" name="QuestionAnswer"
value="<%=Server.HtmlDecode(freqQuestionsUser.questionAnswer)%>" />
Reference
Related
I would like to toggle selection between two different sets of radio buttons.
The condition that must be met is that if the user checks the button on one set (called in the example l1), it is unchecked in the other set (called in the example m1).
In other questions, it seems that it is only feasible solution is using Java scripts.
Below is the code:
<table border="0" cellpadding="1" cellspacing="1" style="width: 500px;">
<tbody>
<tr>
<td style="width: 300px;"> </td>
<td style="width: 100px; text-align: center;">Least</td>
<td style="width: 100px; text-align: center;">Most</td>
</tr>
<tr>
<td>{{question1}}</td>
<td style="text-align: center;"><input name="l1" type="radio" value="-1" /></td>
<td style="text-align: center;"><input name="m1" type="radio" value="1" /></td>
</tr>
<tr>
<td>{{question2}}</td>
<td style="text-align: center;"><input name="l1" type="radio" value="-2" /></td>
<td style="text-align: center;"><input name="m1" type="radio" value="2" /></td>
</tr>
<tr>
<td>{{question3}}</td>
<td style="text-align: center;"><input name="l1" type="radio" value="-3" /></td>
<td style="text-align: center;"><input name="m1" type="radio" value="3" /></td>
</tr>
<tr>
<td>{{question4}}</td>
<td style="text-align: center;"><input name="l1" type="radio" value="-4" /></td>
<td style="text-align: center;"><input name="m1" type="radio" value="4" /></td>
</tr>
</tbody>
This is what i am trying in aspx page
group name is not same in html code how can i manage it pls suggest
i am trying with the radio button in side a repeater control
<asp:Repeater ID="rptGoogleCalenderList" runat="server">
<ItemTemplate>
<tr>
<td style="width: 10px;">
<asp:RadioButton ID="radiocalenderList" CssClass="grpGoogleCalenderList" value="grpGoogleCalenderList" GroupName="GoogleCalenderList" runat="server" />
<%--<input id="" type="radio" name="" />--%>
</td>
<td colspan="3">
<asp:HiddenField ID="hfCalenderId" runat="server" Value='<%#Eval("CalenderId") %>' />
<%#Eval("CalenderName") %></td>
</tr>
</ItemTemplate>
</asp:Repeater>
this is what HTML generated for the above code
<tbody><tr>
<td style="width: 10px;">
<span class="grpGoogleCalenderList"><input id="Content_rptGoogleCalenderList_radiocalenderList_0" type="radio" name="ctl00$Content$rptGoogleCalenderList$ctl00$GoogleCalenderList" value="grpGoogleCalenderList"></span>
</td>
<td colspan="3">
<input type="hidden" name="ctl00$Content$rptGoogleCalenderList$ctl00$hfCalenderId" id="Content_rptGoogleCalenderList_hfCalenderId_0" value="omiai468mpv3ghgojvsgqnsiak#group.calendar.google.com">
my ct calender</td>
</tr>
<tr>
<td style="width: 10px;">
<span class="grpGoogleCalenderList"><input id="Content_rptGoogleCalenderList_radiocalenderList_1" type="radio" name="ctl00$Content$rptGoogleCalenderList$ctl01$GoogleCalenderList" value="grpGoogleCalenderList"></span>
</td>
<td colspan="3">
<input type="hidden" name="ctl00$Content$rptGoogleCalenderList$ctl01$hfCalenderId" id="Content_rptGoogleCalenderList_hfCalenderId_1" value="">
</td>
</tr>
<tr>
<td style="width: 10px;">
<span class="grpGoogleCalenderList"><input id="Content_rptGoogleCalenderList_radiocalenderList_2" type="radio" name="ctl00$Content$rptGoogleCalenderList$ctl02$GoogleCalenderList" value="grpGoogleCalenderList"></span>
</td>
<td colspan="3">
<input type="hidden" name="ctl00$Content$rptGoogleCalenderList$ctl02$hfCalenderId" id="Content_rptGoogleCalenderList_hfCalenderId_2" value="#contacts#group.v.calendar.google.com">
Birthdays</td>
</tr>
<tr>
<td style="width: 10px;">
<span class="grpGoogleCalenderList"><input id="Content_rptGoogleCalenderList_radiocalenderList_3" type="radio" name="ctl00$Content$rptGoogleCalenderList$ctl03$GoogleCalenderList" value="grpGoogleCalenderList"></span>
</td>
<td colspan="3">
<input type="hidden" name="ctl00$Content$rptGoogleCalenderList$ctl03$hfCalenderId" id="Content_rptGoogleCalenderList_hfCalenderId_3" value="en.indian#holiday#group.v.calendar.google.com">
Holidays in India</td>
</tr>
</tbody></table>
Use HTML radio button instead of ASP Radio button:-
<input type="radio" name="GoogleCalenderList" />
Unfortunately, asp radio button don't work inside repeater, so you need to do a work around either at client side or by using HTML control.
My requirement is I want to align my radio button to left in table cell, but it is not happening with the below code:
My code
<div data-role="collapsible" data-theme="b" data-content-theme="b">
<h3>Action</h3>
<table class="tabledata" width="100%">
<tr>
<td class="td1">
<p>
<input id="Radio1" type="radio" value="Approve" /></p>
</td>
<td class="td2">Approve</td>
</tr>
<tr>
<td>
<input id="Radio2" type="radio" /></td>
<td class="td2">Reject</td>
</tr>
<tr>
<td>
<input id="Radio3" type="radio" />
</td>
<td class="td2">Send Back to Requestor</td>
</tr>
<tr>
<td>Amount Approved for Domestic sector : </td>
<td>
<input id="Text1" type="text" /></td>
</tr>
<tr>
<td>Remarks : </td>
<td>
<input id="Text2" type="text" /></td>
</tr>
<tr>
<td class="tabledata">
<input id="Button1" type="button" value="Submit" />
</td>
</tr>
</table>
</div>
My CSS classes:
.td1 {
vertical-align:middle;
text-align:right;
}
.td2 {
text-align: left;
}
Actually I want to keep my radio button and its corresponding text in a table row by combining 2 columns and centre aligned and also submit button shoud be centre aligned in a table row since I am using jquery mobile datarole I guess it is not happening.Please help me to get the look.
After adding the script in head also I am getting below output:
Remove ui-radio class from each radio button.
$('[type=radio]').each(function () {
$(this).closest('div').removeClass('ui-radio');
});
and add class td1 to each radio button.
<tr>
<td class="td1">
<input id="Radio1" type="radio" value="Approve" />
</td>
<td class="td2">Approve</td>
</tr>
<tr>
<td class="td1">
<input id="Radio2" type="radio" />
</td>
<td class="td2">Reject</td>
</tr>
<tr>
<td class="td1">
<input id="Radio3" type="radio" />
</td>
<td class="td2">Send Back to Requestor</td>
</tr>
Demo
Alternative method: No jQuery code is required nor custom CSS styles. Read more about it here.
Why don't you use styled radio buttons, as in the below demo.
Alternative
new CSS:
tr td:nth-child(1) {
vertical-align:middle;
text-align:right;
}
http://jsfiddle.net/yHbdn/1/
I am trying to have my form in a table but it generates a table and makes it a mess.
the generated table is as following:
<div>
<s:form action="myaction" >
<table border="1">
<tr>
<td><s:textfield name="name" label="Name" /></td>
<td><s:textfield name="family" label="Family" /></td>
<td><s:submit/></td>
</tr>
</table>
</s:form>
</div>
Source code :
<div>
<form id="myaction" name="myaction" action="/application/myaction.action" method="post">
<table class="wwFormTable"> <<<generated table
<table border="1">
<tr>
<td><tr>
<td class="tdLabel"><label for="Search_Name" class="label">Name:</label></td>
<td
><input type="text" name="Name" value="" id="Search_Name"/></td>
</tr>
</td>
<td><tr>
<td class="tdLabel"><label for="Search_Family" class="label">Family:</label></td>
<td
><input type="text" name="Family" value="" id="Search_Family"/></td>
</tr>
</td>
<td><tr>
<td colspan="2"><div align="right"><input type="submit" id="Search_0" value="Submit"/>
</div></td>
</tr>
</td>
</tr>
</table>
</table></form>
Use the "simple" theme if you do not want to use S2's default "xhtml" theme.
You'll lose S2's automatic error reporting. You may wish to consider creating your own theme.
Alternatively, you can use the "simple" theme on individual controls.
See the "Themes and templates" docs to get started.
Try to use any theme in struts form tag
eg:
<s:form action="Courses" theme="css_xhtml">
<table border="0">
<tr>
<td><s:textfield name="courseAbbr" /></td>
</tr>
</table>
</s:form>
May Be you should use this code instead...
<sp:form >
<tr>
<td>
<table>
<sp:textfield name="name"></sp:textfield>
</table>
</td>
<td>
<table>
<sp:textfield name="family"></sp:textfield>
</table>
</td>
<td>
<table>
<sp:submit/>
</table>
</td>
</tr>
</sp:form>
i have an outlook web mail login page which have a username and a password fields, to allow you to enter to your inbox, which was supplied by my web site hosting company.
i need a way to put these fields in my main website (powered by asp.net mvc) and then redirect the user to his email inbox using the entered credentials?
how is this possible (in a secure way of course)?
i tried the following html code which was copied from the original site:
<html>
<body>
<form autocomplete="off" name="logonForm" method="POST" action="https://mail.moda.gov.sa/OWA/owaauth.dll">
<input type="hidden" value="https://mail.moda.gov.sa/OWA/" name="destination">
<input type="hidden" value="4" name="flags">
<input type="hidden" value="0" name="forcedownlevel">
<table cellspacing="0" cellpadding="0" align="center" id="tblMain">
<tbody><tr>
<td colspan="3">
<table cellspacing="0" cellpadding="0" class="tblLgn">
<tbody><tr>
<td class="lgnTL"><img alt="" src="/owa/8.2.247.2/themes/base/lgntopl.gif"></td>
<td class="lgnTM"></td>
<td class="lgnTR"><img alt="" src="/owa/8.2.247.2/themes/base/lgntopr.gif"></td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td id="mdLft"> </td>
<td id="mdMid">
<table class="mid" id="tblMid">
<tbody><tr>
<td class="expl" id="expltxt">
</td>
</tr>
<tr><td><hr></td></tr>
<tr>
<td>
<table class="nonMSIE">
<colgroup><col>
<col class="w100">
</colgroup><tbody><tr id="trSec">
<td colspan="2">
Security
(
<a onclick="clkExp('lnkShwSec')" id="lnkShwSec" href="#">
show explanation
</a>
<a style="display:none" onclick="clkExp('lnkHdSec')" id="lnkHdSec" href="#">
hide explanation
</a>
)
</td>
</tr>
<tr>
<td><input type="radio" checked="" onclick="clkSec()" class="rdo" value="0" name="trusted" id="rdoPblc"></td>
<td><label for="rdoPblc">This is a public or shared computer</label></td>
</tr>
<tr style="display:none" class="expl" id="trPubExp">
<td></td>
<td>Select this option if you use Outlook Web Access on a public computer. Be sure to log off when you have finished using Outlook Web Access and close all windows to end your session.</td>
</tr>
<tr>
<td><input type="radio" onclick="clkSec()" class="rdo" value="4" name="trusted" id="rdoPrvt"></td>
<td><label for="rdoPrvt">This is a private computer</label></td>
</tr>
<tr style="display:none" class="expl" id="trPrvtExp">
<td></td>
<td>Select this option if you are the only person who uses this computer. Your server will allow a longer period of inactivity before logging you off.</td>
</tr>
<tr style="" class="wrng" id="trPrvtWrn">
<td></td>
<td>Warning: By selecting this option, you confirm that this computer complies with your organization's security policy.</td>
</tr>
</tbody></table>
</td>
</tr>
<tr><td><hr></td></tr>
<tr>
<td>
<table class="nonMSIE">
<colgroup><col>
<col class="w100">
</colgroup><tbody><tr>
<td><input type="checkbox" checked="" disabled="" onclick="clkBsc();" class="rdo" id="chkBsc"></td>
<td nowrap=""><label for="chkBsc">Use Outlook Web Access Light</label></td>
</tr>
<tr class="disBsc" id="trBscExp">
<td></td>
<td>The Light client provides fewer features and is sometimes faster. Use the Light client if you are on a slow connection or using a computer with unusually strict browser security settings. If you are using a browser other than Internet Explorer 6 or later, you can only use the Light client.</td>
</tr>
</tbody></table>
</td>
</tr>
<tr><td><hr></td></tr>
<tr>
<td>
<table class="nonMSIE">
<colgroup><col class="nowrap">
<col class="w100">
<col>
</colgroup><tbody><tr>
<td nowrap=""><label for="username">User name:</label></td>
<td class="txtpad"><input type="text" class="txt" name="username" id="username"></td>
</tr>
<tr>
<td nowrap=""><label for="password">Password:</label></td>
<td class="txtpad"><input type="password" onfocus="g_fFcs=0" class="txt" name="password" id="password"></td>
</tr>
<tr>
<td align="right" class="txtpad" colspan="2">
<input type="submit" onclick="clkLgn()" value="Log On" class="btn">
<input type="hidden" value="1" name="isUtf8">
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr><td><hr></td></tr>
<tr class="wrng" id="trInvCrd">
<td>The user name or password that you entered is not valid. Try entering it again.</td>
</tr>
</tbody></table>
<table style="display:none" class="mid" id="tblMid2">
<tbody><tr><td><hr></td></tr>
<tr>
<td><br>Please enable cookies for this web site.<br><br>Cookies are currently disabled by your browser. Outlook Web Access requires that cookies be enabled. <br><br>If you are using Microsoft Internet Explorer 6 or later, open Internet Options from the Tools menu. Click the Privacy tab, and then click Sites. Type the address for Outlook Web Access into the field, click Allow, and then click OK to save your changes.<br><br><br></td>
</tr>
<tr><td><hr></td></tr>
<tr>
<td align="right" class="txtpad">
<input type="button" onclick="clkRtry()" value="Retry" style="float: right" class="btn">
</td>
</tr>
</tbody></table>
<table class="mid tblConn">
<tbody><tr>
<td align="right" class="tdConnImg" rowspan="2"><img alt="" src="/owa/8.2.247.2/themes/base/lgnexlogo.gif" style="vertical-align:top"></td>
<td class="tdConn">Connected to Microsoft Exchange</td>
</tr>
<tr>
<td class="tdCopy">© 2007 Microsoft Corporation. All rights reserved. </td>
</tr>
</tbody></table>
</td>
<td id="mdRt"> </td>
</tr>
<tr>
<td colspan="3">
<table cellspacing="0" cellpadding="0" class="tblLgn">
<tbody><tr>
<td class="lgnBL"><img alt="" src="/owa/8.2.247.2/themes/base/lgnbotl.gif"></td>
<td class="lgnBM"></td>
<td class="lgnBR"><img alt="" src="/owa/8.2.247.2/themes/base/lgnbotr.gif"></td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
</form>
</body>
</html>
Does this work?
<form action="https://mail.moda.gov.sa/OWA/auth/owaauth.dll" method="POST" name="logonForm" autocomplete="off">
<input name="destination" value="https://mail.moda.gov.sa/OWA/" type="hidden">
<input name="flags" value="0" type="hidden">
<input name="forcedownlevel" value="0" type="hidden">
<input id="rdoPblc" name="trusted" value="0" class="rdo" checked="checked" type="radio">
<label for="rdoPblc">This is a public or shared computer</label><br />
<input id="rdoPrvt" name="trusted" value="4" class="rdo" type="radio">
<label for="rdoPrvt">This is a private computer</label><br /><br />
<input id="chkBsc" class="rdo" checked="checked" type="checkbox"></td>
<label for="chkBsc">Use Outlook Web Access Light</label><br /><br />
<label for="username">User name:</label>
<input id="username" name="username" class="txt" type="text"><br />
<label for="password">Password:</label>
<input id="password" name="password" class="txt" type="password"><br />
<input class="btn" value="Log On" type="submit">
<input name="isUtf8" value="1" type="hidden">
</form>
As long as your website is trustworthy, it should be secure.
You could try to reverse-engineer the html-form that is used to login to your inbox. If you create the exact same form on your website, it might work.
However, it isn't guaranteed to work, the website might check the referer or use some other checksum to see where the HTTP POST was originated from.
[edit after more information was given]
Two remarks:
1) maybe this post can help you: Sending an OWA logon form from Java
2) try using Fiddler and compare the two requests (the official one and yours). See if there are any arguments missing. Did you copy all javascript etc..
A simple way might be to have an iFrame on your site that links to the inbox login page, but then I guess you've already considered this.
I'm guessing here, but perhaps you have a site, which users log on to. However, you host their e-mail on another site, but you don't want them to have to login twice to access their e-mail.
Michiel makes a very good point in saying that the website might check to see where the HTTP Post comes from. If they do check then you'll have to speak to them. Maybe they can add you to an approved URL list.