|
I am having trouble retrieving the calender selected date value into the javascript function. Any help on this is much appreciated.Thanks. Here is my code:
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"><table>
<tr>
<td align="right" class="style1">Effective Date: </td>
<td><input align="middle" class="gridtext" onblur="DoOnBlur(this)" style="width: 200px" onfocus="DoOnFocus(this)" type="text" id="_EffectiveDate" runat="server" name="_EffectiveDate" maxlength="10">
<button title="Select Effective Date" style="font-size: 11px; cursor: hand; width: 6%; font-family: arial" type="button" id="_effDate" onclick="PickDate('_EffectiveDate')">...</button>
</td>
</tr>
</table>
</asp:Content>
<script type="text/javascript" language="javascript">
function PickDate(sTarget) {
if (showModalDialog) {
var sRtn;
sRtn = showModalDialog("Calendar.asp", "", "center=yes;scroll=no;status=no;dialogWidth=280px;dialogHeight=190px");
if (sRtn != "" && sRtn != "undefined")
if (sTarget != '')
document.getElementById(sTarget).value = sRtn;
} else
alert("Internet Explorer 4.0 or later is required.")
}
</script>
|
|
|
|
|
You're using a master page, so the client-side ID of the textbox will not be _EffectiveDate ; it will most likely be something like ContentPlaceHolder1__EffectiveDate instead.
To fix the problem set the ClientIDMode property[^] on the textbox to Static .
Also, showModalDialog was removed from Chrome in May[^], and from Firefox in June[^]. It's deprecated in IE11, and not supported in Microsoft Edge. There are various options to replace this deprecated method - for example, these two[^] polyfills[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
It is about the alert on the website. I am already using the javascript language to implement this alert. It works well.
but, I have got two alerts now.
but in the website, i want to display one alert per day.
Can we alternate it with alert 2 on the next day, then back to alert 1 on the day after, and keep it going like this for few weeks (atleast two weeks)?
Any ideas to automate this using javascript?
|
|
|
|
|
Let it be purely on client-side.
1. Toggle the 2 alert boxes based on odd or even day of the date.
2. Set a cookie[^] which expires in say 4 weeks to control the life span of these alert boxes.
Hope it helps.
modified 8-Sep-15 7:38am.
|
|
|
|
|
Greetings again expert,
The way the current code works is that a user checks one of three checkboxes, the associated textbox is displayed.
If all three checkboxes are checked, all three textbox controls are displayed.
By default, upon page load, all three textboxes are hidden.
For instance, if a user checks Job Title / Classification, this control below is displayed:
<div style="float: left; margin-right: 10px; margin-left: 10px">
<asp:TextBox ID="txtTitleChange" runat="server" placeholder="Job Title / Classification" Style="margin-right: 0px; width: 200px; display: none;" />
</div>
If a user checks Pay Grade, then this is displayed:
<div style="float: left; margin-right: 10px">
<asp:TextBox ID="txtPayGradeChange" runat="server" placeholder="for Pay Grade" Style="margin-right: 0px; width: 200px; display: none;" />
</div>
If a user checks Class Specification, then this is displayed:
<div style="float: left; margin-right: 10px">
<asp:TextBox ID="txtClassSpecChange" runat="server" placeholder="for Class Specification" Style="margin-right: 0px; width: 200px; display: none;" />
</div>
If a user checks all three checkbox controls, all three textbox controls are displayed
This works great.
However, we need to improve on this.
On the JUSTIFICATION FOR REQUEST section, we also need to hide by default, all three rows.
For instance, if a user checks Job Title / Classification, we would like the textbox control above, as well as txtTiel textbox control to display as well.
As with above, if a user checks all three, we would like all three textbox controls, as well as all three controls under JUSTIFICATION FOR REQUEST section to be displayed.
I am having issues wrapping around making the changes to exsiting code.
Your assistance is greatly appreciated.
<script type="text/javascript">
function ShowHide(chk, txt) {
ctrltxt = document.getElementById(txt);
if (chk.checked) {
ctrltxt.style.display = 'block';
}
else {
ctrltxt.style.display = 'none';
}
}
</script>
<table style="border: 0; border-style: solid">
<tr valign="top" style="background-color: #f5f7f7; font-size: large; white-space: nowrap;">
<td style="font-size: large; font-weight: bold;">Request a Review of:</td>
<td>
<asp:CheckBoxList ID="ckRequestReview" runat="server" CssClass="cb" Style="border-width: 0;" RepeatDirection="horizontal" RepeatColumns="4" RepeatLayout="Table">
<asp:ListItem onclick="ShowHide(this,'txtTitleChange');"> Job Title / Classification</asp:ListItem>
<asp:ListItem onclick="ShowHide(this,'txtPayGradeChange');">Pay Grade</asp:ListItem>
<asp:ListItem onclick="ShowHide(this,'txtClassSpecChange');">Class Specification</asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
</table>
<table style="border: 0; border-style: solid">
<tr valign="top">
<td valign="middle" style="font-size: large; font-weight: bold; border-top: thin solid; text-align: left; white-space: nowrap" class="style4">
<br />
<div class="input text" style="float: left;">
<span style="text-align: left; font-size: x-large; float: left;">Requested Change:</span>
<div style="float: left; margin-right: 10px; margin-left: 10px">
<asp:TextBox ID="txtTitleChange" runat="server" placeholder="Job Title / Classification" Style="margin-right: 0px; width: 200px; display: none;" />
</div>
<div style="float: left; margin-right: 10px">
<asp:TextBox ID="txtPayGradeChange" runat="server" placeholder="for Pay Grade" Style="margin-right: 0px; width: 200px; display: none;" />
</div>
<div style="float: left; margin-right: 10px">
<asp:TextBox ID="txtClassSpecChange" runat="server" placeholder="for Class Specification" Style="margin-right: 0px; width: 200px; display: none;" />
</div>
<div style="clear: both"></div>
</div>
<br />
<br />
<br />
</td>
</tr>
</table>
<table>
<tr>
<td>
<!--
<span style="font-size: X-large; text-align: left;">JUSTIFICATION FOR REQUEST</span><br />
<div class="input textarea">
<table>
<tr>
<td style="font-size: large;" class="style22">
<asp:Label ID="txtTitle" runat="server" Text="Job Title / Classification" Style="width: 200px;" Font-Bold="False"></asp:Label></td><td><asp:TextBox ID="txtTitleComments" runat="server" placeholder="Title Change Justification" Style="width: 400px;height:100px;" Font-Bold="False" TextMode="MultiLine"></asp:TextBox></td>
</tr>
</table>
<table>
<tr>
<td style="font-size: large;" class="style21">
<asp:Label ID="txtPayGrade" runat="server" Text="Pay Grade" Style="width: 200px;" Font-Bold="False"></asp:Label></td><td><asp:TextBox ID="txtPayComments" placeholder="Pay Grade Change Justification" runat="server" Style="width: 400px;height:100px;" Font-Bold="False" TextMode="MultiLine"></asp:TextBox></td>
</tr>
</table>
<table>
<tr>
<td style="font-size: large;" class="style22">
<asp:Label ID="txtClassification" runat="server" Text="Class Specification" Style="width: 200px;" Font-Bold="False"></asp:Label></td><td><asp:TextBox ID="txtClassComments" placeholder="Class Specification Change Justification" runat="server" Style="width: 400px;height:100px;" Font-Bold="False" TextMode="MultiLine"></asp:TextBox></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
|
|
|
|
|
Hi All,
I am trying to come up with an algorithm to get following three piece of information to plot a chart:
1. Start : Should be close to the minimum value of the dataset
2. Stop : Should be close to the maximum value of the dataset
3. Interval : Should be such that it will have "0" on the axis when interval traverses from minimum to maximum.
Example: dataset{-266,-17.6,0.5,2000,6000}
My final return values should be:
Start: 400
Stop: 6000
Interval:200
Note: Since start is 400 and interval is 200, we will have 0 as a point on the x-axis.
|
|
|
|
|
Does this have anything to do with Javascript?
|
|
|
|
|
I am going to implement this is javascript. We have data in csv format which will be read by the JS function and the start, stop and interval will be sent to third party library to create chart.
The algorithm I am looking for can be pseudo code. It's not specific to JS, but would be a big help to know if some one would have implemented this using JS.
|
|
|
|
|
Post it in the Algorithms section and explain the problem better too. I have no idea why your data results in the values you are expecting.
|
|
|
|
|
|
export html page with icons (font awesome) as image using javascript.
i have a map on that i render icons (font awesome), first i process map(SVG) but icons not render , by using html2canvas
|
|
|
|
|
|
"{
"odata.metadata": "https://XYZ",
"value": [],
"DateTime": "2015-08-31T14:44:04Z"
}"
Datetime i found in httpresponce.body but its not retreiving
How i can get DateTime value using javascript
Gopal Kanjolia
Cyber Infrastructure Pvt. Ltd.
|
|
|
|
|
pls i need help with my ticket reservation page.
am designing an online ticket reservation system using php.
i have done some little work. below are my codes.
<form action="boarding_point.php" method="POST">
<?php
$N = $colums+1;
for($i=1; $i < $N; $i++)
{
?>
<script type="text/javascript">
var seatno = "<?php echo $row[$i]?>";</script>
<?php
echo '<input type="submit" style="border:none; width:50px; height:50px; padding:2px; margin:2px; background:url(img/available_seat_img.gif) no-repeat scroll 0 0 transparent; hover:{background:yellow}; " value="'.$i.'" name="'.$i.'" onmouseover="tooltip.show(seatno);" onmouseout="tooltip.hide();"/>';
}
modified 22-Aug-15 15:05pm.
|
|
|
|
|
Better way to Detecting if a browser is in full screen mode by javascript .
|
|
|
|
|
|
He wants to detect, not use browser in fullscreen mode.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Yes - and the API says that document.fullscreenElement (or the prefixed version) should tell you which element is full screen, or if none are.
Or maybe what he was really asking about was a maximized browser window, which doesn't really mean anything from the browser's point of view.
|
|
|
|
|
Actually, the question of OP was of type "Not a question". He had thought of a feature but did not know whether to use it or not. Websites should consider working with the viewport, rather than taking control of the browser itself.
What he was thinking about was to get the state whether browser itself (not some element) is in full screen mode (maximized in application words) or not. HTML documents have control only to the viewport, or the DOM. He wanted to control the browser itself. Which is not possible until now, your API library was good and helpful in most cases. But the question itself was of no good reason.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
You cannot. Browser doesn't allow a website to manipulate or detect the states using JavaScript.
Only thing that you can do is to determine the size of window. For example,
var width = $(window).width();
var height = $(window).height();
But that doesn't work when the screen sizes are different, does it? So there is no chance that you can create such a functionality.
Maybe some day later.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Hello
I have a page that displays search results. I'm looking for a way to have those search results printed. However, there are some items (ads, menus, etc) that should not be printed.
What I have so far is the results are sent to a new tab (using javascript) with the search results. All of the items that shouldn't be visible have been removed. However, only the text shows up. All the CSS styles and images aren't showing up.
Since the results are already being displayed, I'm trying to avoid having the server execute the search again.
Another thing to keep in mind, this is an SPA app (i.e. the URL never changes throughout the site).
My guess is since the html is getting sent to a new tab, the root URL is not set. So when it comes to a relative path for the images, css and script files, it doesn't know how to build the full path.
Does anyone know of a way to get this method to work? I know I can get this to work by having the server execute the search again, but I'm trying to see if there's a client side solution.
Thanks!
|
|
|
|
|
Look at CSS media queries. You should be able to serve the ads, etc, in something like
<div class = "noprint"> ... </div> and have
@media print {
.noprint {
display : none
}
} or something similar in your CSS, so when the browser renders for printing, it will hide the ads, etc. You might need some fancy footwork elsewhere in your CSS to make things look right both on screen and paper.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Hi all could anyone help me out I'm stuck on a question :
Write a function called validate that takes a single sting argument. The function should return true if and only if the string contains at least one dot (".") and exactly one "@" symbol.
E.g. validate ("j.nicholson@southampton.ac.uk")===true
Please could someone help i just can't get my head around it, thanks!
|
|
|
|
|
|
You are looking for a simple email validator e.g.
function validateEmail(email) {
var regEx = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (regEx.test(email)) {
return true;
} else {
return false;
}
}
|
|
|
|