Validate Date Range - Javascript
Hi Gang,
This is close to a repost... but more of a followup to a
thread that has
already moved down everyones list.
I have a pretty simple form validation routine I need to
implement, but I
don't know the Javascript syntax well enough to work it out
(my background
is VBscript, but this needs to be client side). I received
some good URL's
to check out some free scripts.. but unfortunately, I don't
know javascript
well enough to hack them up correctly.
If someone can help out with a bit of code, it would be a
huge help.
What I need to do is validate a numeric range as well as not
leaving the
field blank.
For example what is entered must be a number between 1900 and
2006.
Here is what I am using for the basic required function:
The name of the form is "ThisForm_Right", and the field name
is "DOB_Year"
(to explain the piece in the code below)
if (ThisForm_Right.DOB_Year.value=="")
alert ("Please enter the YEAR of your DOB.");
ThisForm_Right.DOB_Year.focus();
return false;
Can some kind sole help with a modified version to also check
for an entered
number range?
I suspect some sort of "And" statement, Like
If
ThisForm_Right.DOB_Year.Value==""
AND
Year.Value NOT between (1900 and 2006)
alert ("Please enter the YEAR of your DOB between 1900 and
2006.");
ThisForm_Right.DOB_Year.focus();
return false;
I just don't know the real syntax :>
Thanks
-D
>thanks you so much for the code, I'll test it out and
reply with >the
>results.
Shouldn't that be "Thanks so much for the Cod"?
"Dave Bar" <[email protected]> wrote in message
news:e28c7t$hk1$[email protected]..
> ahh yes, you are right..
> I should have said OR instead of AND.
> If Field is blank OR range is not between 1900 &
2006. Thanks for catching
> and pointing that out.
>
> thanks you so much for the code, I'll test it out and
reply with the
> results.
> Thanks
> -Dave
>
>
>
>
> "Lionstone" <[email protected]> wrote
in message
> news:e28b1a$fu5$[email protected]..
>> That's probably because you asked for a fish to help
you out
>>
>>> Can some kind sole help with a modified version
to also check for an
>>> entered
>>> number range?
>>
>> and fish can't type.
>>
>> You're off on the logic though, since something is
not likely to be both
>> blank and outside a certain number range. If it's
blank or outside the
>> range, either condition is sufficient for an error,
right?
>> You also want to make sure that no letters, etc, are
entered, because
>> that will mess up your comparisons to the other
numbers. Keeping in mind
>> that javascript validation can be defeated by
sneezing and you'll need to
>> re-validate on the server, this will be closer to
right (not tested).
>>
>> var ThisYear = ThisForm_Right.DOB_Year.value;
>> ThisYear = ThisYear.replace(/[^/d]/g,"");
>> if(ThisYear.length == 0)
>> {
>> alert("Please enter the year of your DOB.");
>> ThisForm_Right.DOB_Year.focus();
>> return false;
>> }
>> else
>> {
>> ThisYear = parseInt(ThisYear);
>> if((ThisYear < 1900) || (ThisYear > 2006))
>> {
>> alert ("The year of your DOB must be between 1900
and 2006.");
>> ThisForm_Right.DOB_Year.focus();
>> return false;
>> }
>> }
>>
>>
>
>
Similar Messages
-
Validate Date Range in inputDate component
Hi
I am using JDev 11.1.1.2.0
I have an inputDate component which on click i need to give dates from today to future dates not passed dates.
So i have included 'validate date time range' component in the inputDate component and in the minimum property i have declared 'adf.currentDate' using expression builder and set the maximum as Jan 31,2099.
But when i execute my application i am able to select passed dates using the inputDate component, please help how can i check the date using a validator in inputDate component.
Thanks
Sudeepya i had tried with that property too....
i have declared minValue as adf.currentDate and on that it changes the value of maxValue to current date in Jan 3,2012
i have convertDatetime component in my inputDate to display the selected date in certain format.
It gives error as the format doesnot matches with the convertDatetime and inputDate component.
How can i use the minValue and maxValue of inputDate component?
the component:-
<af:inputDate
label="Planned Termination Date"
id="id2"
value="#{modifyuser.pterminationdate}"
valueChangeListener="#{modifyuserfields.plannedTermDate}"
minValue="adf.currentDate" maxValue="2099-12-31">
<af:convertDateTime pattern="dd-MMM-yyyy"/>
</af:inputDate> -
Validate date range overlapping
Hello all. I am trying to write a code which checks if the date does not overlap. For example, in my form I have id, from_date (mm/dd/yyyy), to_date (mm/dd/yyyy).. what i am trying to do is, the dates must not ovelap for particular id..
Sample:
id | from_date | to_date
1 | 01/01/2012 | 01/31/2012
1 | 04/01/2012 | 04/30/2012 --> this must be allowed
2 | 01/15/2012 | 01/15/2012 --> this must also be allowed as id differs
1 | 01/15/2012 | 01/15/2012 --> this must not be allowed because for id=1, 15th Jan is overalapping with the 1st row's date range (1st Jan to 31st Jan).
PS : I dont want to use DB trigger, but rather write a code in Backing bean
(I will let you know what code i tried so far, if needed)
Edited by: 925715 on Apr 5, 2012 3:36 AMAssalaam Alaikum Jabr. thankss for the reply. For some reason it doesn't seem to work. I tried to create a validation method, at Entity level and also at Attribute level in Entity class of detail table. it is committing all the dates. Any ways, i will check again, if I am missing something here. And, must the validator be created at entity or attribute level??
Edited by: 925715 on Apr 7, 2012 4:32 PM -
Validate Date and block JavaScript page change
how I can validate date acrobat, can block JavaScript page change, only change with a button?
If you use the "util.scand" method date validation is part of the process. It either returns the number of milliseconds from the Epoch date used by JavaScript for the date time object the null value.
Date Arithmetic has some sample scripts, but you need to keep in mind that Date and Time are not independent and using "new Date()" returns the date and time at the time that line of code is executed and that can cause issues for the computing of dates only.
Are you sure of day count, most differences include the start and end dates in the number of days for the calculation.
Custom calculation for today's date field (format is None):
// get today's date an time
var oToday = new Date();
// set to start of day
oToday.setFullYear(oToday.getFullYear(), oToday.getMonth(), oToday.getDate(), 0, 0, 0, 0)
// set field value
event.value = util.printd("d/mm/yyyy", oToday);
Custom calculation for the difference in days field (format None):
var cEnteredDate = this.getField("EnteredDate").value;
var cToday = this.getField("Today").value;
event.value = "";
if(cEnteredDate != "" && cToday != "") {
// process only if date values not empty
// convert date strings to date time objectat midnight
var oEnteredDate = util.scand("d/mm/yyyy", cEnteredDate );
if (oEnteredDate == null) {
app.alert("Error in processing entered date", 2, 0);
oEnteredDate.setFullYear(oEnteredDate.getFullYear(), oEnteredDate.getMonth(),oEnteredDate.getDate(), 0, 0, 0, 0)
var oToday = util.scand("d/mm/yyyy", cToday);
if(oToday == null) {
app.alert("Error converting today", 2,0);
oToday.setFullYear(oToday.getFullYear(), oToday.getMonth(),oToday.getDate(), 0, 0, 0, 0)
// convert date objects to days
var nEnteredDate = Math.floor(oEnteredDate.getTime() / (1000 * 60 * 60 * 24));
var nToday = Math.floor(oToday.getTime() / (1000 * 60 * 60 * 24));
// compute & format the difference
event.value = util.printf("%,0 1.0f", (nToday - nEnteredDate)); -
Dear all,
I am very new to Sharepoint designer 2010. Its better to say, i am just stepping in.
I have sharepoint site which is accessible for all the users to update few information. But i want this site not to be accessible during a date range, say from 15th to 20th of every month.
I am planning to have something like this: If any user tries to access this sharepoint site between 15th to 20th date range of everymonth, then the browser must show an pop-up alert saying "This site is not accessible during this date range" and Redirect
this sharepoint site to someother site (Say http:// somesitename.xx.com) immidiately.
I know very little about how to add Javascript in sharepoint webpart.
Please provide the Javascript or any best alternate solution to my concern.
Thanks in advance.Hi,
From your description, my understanding is that you want to redirect sharepoint site to another site between 15th and 20th every month.
I agree with what Sudip says. If you still want to use JS code,You could try these steps
below:
Open your site with SharePoint Designer.
Click Master Pages in left navigation.
Find file v4.master, and backup it(it is very important).
Right click your v4.master,
choose "Edit File in Adavance Mode".
Add the code below into the <head/> tag.
<script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script><script
type="text/javascript">
$(document).ready(function(){
var today = new Date();
var day = today.getDate(); // get current day
var id = _spPageContextInfo.userid; // get the id of current logon in user
var boolFlg = false;
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/SiteGroups/GetByName(\'"+"sharepoint Owners"+"\')/Users", //get users in a specified group can access the sharepoint site from 15th to 20th every
month
type: "GET",
headers: {"accept": "application/json;odata=verbose"},
success: function (data) {
if (data.d.results) {
var src = data.d.results;
for(var i = 0; i < src.length; i++){
if(src[i].userid==id){ //check the logon in user in the specified group or not
boolFlg = false;
break;
if(!boolFlg){
if(day <= 20 && day >=15){
alert("This site is not accessible during this date range"); // alert the message
location.href = "http:// somesitename.xx.com"; // redirect to another site
error: function (xhr) {
alert(xhr.status + ': ' + xhr.statusText);
})</script>
Best Regards
Vincent Han
TechNet Community Support -
How to limit data range in a Line chart with Time Refresh Control
Hi All,
I have a Line chart with Time Refresh Control and I would like to make some constraints to this navigation.
For example, I would like to limit the user to navigate in a data range of 8 hours.
Is this posible?
Thanks in advanceHi Pedro,
as far as I know, this is not possible using the time controls on an iChart. However, you may have some success by using your own time controls which call JavaScript methods exposed by the applet.
For example, you could begin by hiding the time and calendar buttons on an iChart, and creating some buttons of your own. For instance, to set the start date of a query (and thus the start date of the iChart using the query), you can use the following:
document.getElementById("appletID").getQueryObject().setStartDate(<date string>);
Using code like the above (look into the xMII script assistant and documentation), you should be able to build time controls which satisfy your requirements. The exact format of <date string> in the sample above will depend on the date format defined in the query template this script calls.
Hope this helps,
Sascha -
Using spry to filter age or date range?
I'm trying to create a spry filter to filter between age or date ranges. I can get the code to filter an age if it's greater or below a number, but not a range between numbers. How can I modify the following code to filter between a range of numbers? I would prefer to use drop down for age range choices so the user can choose each age from a drop down menu but I wasn't having much luck with it whereas the checkbox was somewhat working for me. If someone has a drop down method to select ages and have spry filter between the values I would be very grateful. Many thanks in advance!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Multiple Filters Sample</title>
<link href="http://labs.adobe.com/technologies/spry/css/samples.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/includes/xpath.js"></script>
<script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/includes/SpryData.js"></script>
<script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/includes/SpryDataExtensions.js"></script>
<script type="text/javascript">
<!--
var dsStates = new Spry.Data.XMLDataSet("states.xml", "states/state");
dsStates.setColumnType("name", "number");
function ff15(ds, row, index){ var c = row.name; return c >= '6' && c <= '100' ? null : row; };
function ffIP(ds, row, index){ var c = row.name; return c >= '11' && c <= '100' ? null : row; };
function ffQZ(ds, row, index){ var c = row.name; return c >= '0' && c <= '10' ? null : row; };
function ToggleFilter(enable, f)
if (enable)
dsStates.addFilter(f, true);
else
dsStates.removeFilter(f, true);
function RemoveAllFilters()
document.forms[0]["f15"].checked = false;
document.forms[0]["fIP"].checked = false;
document.forms[0]["fQZ"].checked = false;
dsStates.removeAllFilters(true);
-->
</script>
</head>
<body>
<div class="liveSample" style="float: left; margin-bottom: 4px;">
<form action="">
<label>Show '1' - '5': <input name="f15" type="checkbox" value="" onclick="ToggleFilter(this.checked, ff15);" /></label><br />
<label>Show '6' - '10': <input name="fIP" type="checkbox" value="" onclick="ToggleFilter(this.checked, ffIP);" /></label><br />
<label>Show '11' - '20': <input name="fQZ" type="checkbox" value="" onclick="ToggleFilter(this.checked, ffQZ);" /></label><br />
<input type="button" value="Remove All Filters" onclick="RemoveAllFilters();" />
</form>
<div spry:region="dsStates" spry:repeatchildren="dsStates">
<span>{name}</span>
</div>
</div>
</body>
</html>
<states>
<state>
<name>1</name>
</state>
<state>
<name>2</name>
</state>
<state>
<name>3</name>
</state>
<state>
<name>4</name>
</state>
<state>
<name>5</name>
</state>
etc. etc.
</states>The syntax for the xml file along with the rest of the source was provided in the original post. Here's the modified html file. How do I concactenate if (cat = 2) if (cat = 3) etc. into the function? Thanks in advance.
Also as you can see from my modified html source, I want two separate drop downs: one for MINage and one for MAx age. From looking at my provided source I have a feeling that when a user clicks on one or the other drop downs it will trigger the function for that selection and cancel the other filter out, which is undesired. So I am wondering how to have two drop downs work to filter between min and max age where if a user clicks on one drop down it doesn't cancel the function of the previous filter selection.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Multiple Filters Sample</title>
<link href="http://labs.adobe.com/technologies/spry/css/samples.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/includes/xpath.js"></script>
<script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/includes/SpryData.js"></script>
<script language="JavaScript" type="text/javascript" src="http://labs.adobe.com/technologies/spry/includes/SpryDataExtensions.js"></script>
<script type="text/javascript">
<!--
var dsStates = new Spry.Data.XMLDataSet("states.xml", "states/state");
dsStates.setColumnType("name", "number");
function MINage(cat){
if (cat = 1)
dsStates.setXPath('states/state[name > 0]');
dsStates.loadData();
function MAXage(cat){
if (cat = 10)
dsStates.setXPath('states/state[name < 10]');
dsStates.loadData();
-->
</script>
<style type="text/css">
<!--
.badge {
float: left;
margin: 4px;
padding: 4px;
text-align: center;
background-color: #FFCC99;
border-top: solid 1px #999999;
border-left: solid 1px #999999;
border-bottom: solid 1px #CCCCCC;
border-right: solid 1px #CCCCCC;
label {
font-weight: bold;
-->
</style>
</head>
<body>
<h3>Multiple Filters Sample</h3>
<div class="liveSample" style="float: left; margin-bottom: 4px;">
<form action="">
<select name="ageCat" onchange="MINage(this.value)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
<option value="32">32</option>
<option value="33">33</option>
<option value="34">34</option>
<option value="35">35</option>
<option value="36">36</option>
<option value="37">37</option>
<option value="38">38</option>
<option value="39">39</option>
<option value="40">40</option>
<option value="41">41</option>
<option value="42">42</option>
<option value="43">43</option>
<option value="44">44</option>
<option value="45">45</option>
<option value="46">46</option>
<option value="47">47</option>
<option value="48">48</option>
<option value="49">49</option>
<option value="50">50</option>
<option value="51">51</option>
<option value="52">52</option>
<option value="53">53</option>
<option value="54">54</option>
<option value="55">55</option>
<option value="56">56</option>
<option value="57">57</option>
<option value="58">58</option>
<option value="59">59</option>
<option value="60">60</option>
<option value="61">61</option>
<option value="62">62</option>
<option value="63">63</option>
<option value="64">64</option>
<option value="65">65</option>
<option value="66">66</option>
<option value="67">67</option>
<option value="68">68</option>
<option value="69">69</option>
<option value="70">70</option>
<option value="71">71</option>
<option value="72">72</option>
<option value="73">73</option>
<option value="74">74</option>
<option value="75">75</option>
<option value="76">76</option>
<option value="77">77</option>
<option value="78">78</option>
<option value="79">79</option>
<option value="80">80</option>
<option value="81">81</option>
<option value="82">82</option>
<option value="83">83</option>
<option value="84">84</option>
<option value="85">85</option>
<option value="86">86</option>
<option value="87">87</option>
<option value="88">88</option>
<option value="89">89</option>
<option value="90">90</option>
<option value="91">91</option>
<option value="92">92</option>
<option value="93">93</option>
<option value="94">94</option>
<option value="95">95</option>
<option value="96">96</option>
<option value="97">97</option>
<option value="98">98</option>
<option value="99">99</option>
</select>
<select name="ageCat" onchange="MAXage(this.value)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
<option value="32">32</option>
<option value="33">33</option>
<option value="34">34</option>
<option value="35">35</option>
<option value="36">36</option>
<option value="37">37</option>
<option value="38">38</option>
<option value="39">39</option>
<option value="40">40</option>
<option value="41">41</option>
<option value="42">42</option>
<option value="43">43</option>
<option value="44">44</option>
<option value="45">45</option>
<option value="46">46</option>
<option value="47">47</option>
<option value="48">48</option>
<option value="49">49</option>
<option value="50">50</option>
<option value="51">51</option>
<option value="52">52</option>
<option value="53">53</option>
<option value="54">54</option>
<option value="55">55</option>
<option value="56">56</option>
<option value="57">57</option>
<option value="58">58</option>
<option value="59">59</option>
<option value="60">60</option>
<option value="61">61</option>
<option value="62">62</option>
<option value="63">63</option>
<option value="64">64</option>
<option value="65">65</option>
<option value="66">66</option>
<option value="67">67</option>
<option value="68">68</option>
<option value="69">69</option>
<option value="70">70</option>
<option value="71">71</option>
<option value="72">72</option>
<option value="73">73</option>
<option value="74">74</option>
<option value="75">75</option>
<option value="76">76</option>
<option value="77">77</option>
<option value="78">78</option>
<option value="79">79</option>
<option value="80">80</option>
<option value="81">81</option>
<option value="82">82</option>
<option value="83">83</option>
<option value="84">84</option>
<option value="85">85</option>
<option value="86">86</option>
<option value="87">87</option>
<option value="88">88</option>
<option value="89">89</option>
<option value="90">90</option>
<option value="91">91</option>
<option value="92">92</option>
<option value="93">93</option>
<option value="94">94</option>
<option value="95">95</option>
<option value="96">96</option>
<option value="97">97</option>
<option value="98">98</option>
<option value="99">99</option>
</select>
</form>
<div spry:region="dsStates" spry:repeatchildren="dsStates">
<span class="badge">{name}</span>
</div>
</div>
<p><br style="clear: both;" />
</p>
</body>
</html>
Thanks! -
How can I set a date range for a Date/Time Field in LiveCycle ES2?
I need to set a specific date range for a form set up in LiveCycle ES2. Cannot see where i allows me to do that without a code entered.
Hi,
You can't set a start and end date for the date/time field, the best you can do is validate the range after the user has selected it.
An alternate is to make your own date / time field, like this sample http://adobelivecycledesignercookbookbybr001.blogspot.com.au/2013/05/an-alternative-date-p icker-for.html
Regards
Bruce -
Developing prompts to enter a date range
I need to develop a report for an agency allowing their user to select information from a table, between a user specified date range, which could change daily. The user needs to be prompted to enter a city, a start date, and an ending date... Then display and print this report based on their entered criteria. I would like to use the pop-up date pickers if possible. Can you give me some direction as to how I would go about developing the required prompts.
Raj,
Thank you for your help, I believe it is what I am trying to do. I am still having trouble bringing back data.. I feel that I am very close..
The new page I created was PAGE 33.. On this page I have
REGION:
REGION: (Title-Retail-Labels)
TYPE : SQL Query
REGION SOURCE:
select name,address,city,state,zip
from retail
where RENEWAL_DATE between to_date(:P33_START_DATE,'DD-MON-YY') and to_date(:P33_END_DATE,'DD-MON-YY')and POD =:P33_POD
X Use Query-Specific Column Names and Validate Query
ITEMS:
10: P33_START_DATE Date Picker (DD-MON-YY) (Source:SQL Query)
20: P33_END_DATE Date Picker (DD-MON-YY) (Source:SQL Query)
30: P33_POD TextField (Source:SQL Query)
I am querying data from the Retail table with the following columns.
ID, Name, Address, City, State, Zip, Telephone, Fax, Permit, Renewal_Date, Owner, Contact, SalesTax, Violations, Compliance, Lease, Look, County, POD
If I modify my query to say where renewal_date is not null or POD is not null I pull back the appropriate records..
POD (column name) is basically point of destination and is a city..
When I run the page it allows me to select two dates and type in a city. I have a Submit button to submit to page 33... It says no data found (the default).
Does anything look incorrect..
Thank you in advance for your help,
Kevin -
we want to validate data in web form in planning through Java Script Code ?
how we can do it and what is the location of that Java Script file ?
One more thing ... if we make any changes in Java Script code then is it necessary to stop and start planning server or application ?
Thanks in Advance ..... :-)Hi,
you can resolve this problem, adding a JavaScript code in validateData.js.
For example you can change and/or insert the code in validateForm function, that save the data only if the function return true.
There are also another function and the code example in SampleValidateData.js that you can see.
You find the ValidateData.js in the folder "custom" of your installation.
For example:
/default web application directory/deployments/your web server/HyperionPlanning/webapps/HyperionPlanning/custom
I report an example for control the data before saving it:
function validateForm(){
if (equalsIgnoreCase(applicationName,"BDG"))
if (equalsIgnoreCase(formName,"1.10A ECO"))
var rowPrecVers = currentDataGrid.endRow;
var colPrecVers = 2;
var rowActVers = 3;
var colActVers = 3;
var valTotPrecVers = 0;
var valTotActVers = 0;
valTotPrecVers = currentDataGrid.fullPrecision[rowPrecVers][colPrecVers];
for(rowActVers; rowActVers < currentDataGrid.endRow; rowActVers++){
valTotActVers = valTotActVers + parseFloat(currentDataGrid.fullPrecision[rowActVers][colActVers]);
if(valTotPrecVers < valTotActVers){
alert("Ops!!!Don't match" + "\n"
+ "Previous Version: " + valTotPrecVers + "\n"
+ "Actual Version: " + valTotActVers);
valid = false;
return valid;
else{
return valid;
Insert and modify this code in validateForm function.
If in your installation use Tomcat web server, you must save the change on the ValidateData.js file each time. If you use the WebLogic web server tou must restart the service. For other web server I don't know.
Take it easy and have fun!!!
Flavio -
Need help! Can't validate date overlaps for a tabular column
Hello all,
The validation I created to validate whether new or updates rows does not overlap with any records in the table isn't working.
The columns are StartDt and EndDt
Validation Type: NOT EXISTS
Validation expresion:
select 1
from sample S
WHERE S.STARTDT BETWEEN :STARTDT AND :ENDDT
OR(S.ENDDT BETWEEN :STARTDT AND :ENDDT)
or (S.STARTDT <= :STARTDT and S.ENDDT >= :ENDDT)
or (:STARTDT <= S.STARTDT and :ENDDT >= S.ENDDT)
Error Message:
Times overlap
When Buttons pressed
-Select Button-
The validation works if a new row or updated row overlaps any existing start and end date records but it doesn't work if I update startdate and end date rows that doesn't overlap existing date times
Example:
TABLE DISPLAYS THE FOLLOWING RECORDS
NAME START DATE END DATE
TEST 1/1/2012 12/31/2012
If I update the rows to the following values, I receive an error message (although those values don't overlap any records in the table)
NAME START DATE END DATE
TEST 6/1/2012 10/30/2012
Any ideas? Do I need to change my code?
Click the link to view the answer to this question. Need help! Can't validate date overlaps for a tabular column
Message was edited by: CharlieMackLogic for date range overlap testing only requires two conditions in the WHERE clause:
ORACLE-BASE - Overlapping Date Ranges
WHERE S.STARTDT <= :ENDDT AND S.ENDDT >= :STARTDT -- TRUE for ranges that overlap
It looks a little odd, but, if you scribble out a 'logic table', it makes sense.
Condition
A.start <= B.end
A.end >= B.start
A__A B--B
true
false
A__B=A--B
true
true
A__B==B__A
true
true
B--A==B__A
true
true
B--B A__A
false
true
MK -
Multi-month, year, and date-range views
My apologies for wasting everyone's time if I've missed something really obvious here, but am I correct in concluding that there is no way to generate anything beyond a static one-month view in iCal? No multi-month view? No year view? No "view date range"? At this stage of the game, how is it possible that something so elemental could be omitted from this program?
At this point I'm reduced to exporting each month to a pdf file and then arranging them as tiles on the screen. But there has to be a better way.
Short of a new version from Apple, are there any plug-ins that would do this? Does anyone have any other work-arounds? Thanks in advance.A quick search of the forums shows that this is a HIGHLY sought after feature (including by me). We all need to use the feed back link (below) to let Apple know this. In my experience with the tech support folks, they seem to have NO idea about what these forums say. In the past I have actually had them log in to these forums and search the issue I was calling them about and they have been blown away when they see the hundreds / thousands of posts with the very same thing they're discussing with me. So, as the wise man says .. "you don't ask, you don't get!" Use the form and let them know...
http://www.apple.com/feedback/ical.html -
How to get top 11 values per date range
I want to get the top 11 values by date range.
Sample Data
CREATE TABLE SAMPLE_DATA
DOMAIN_NAME VARCHAR2(100),
QTD NUMBER,
LOAD_DATE DATE
-- Insert
BEGIN
FOR lc IN 1..20
LOOP
FOR ld IN 1..30
LOOP
INSERT
INTO SAMPLE_DATA VALUES
'DM_'
||lc,
round(dbms_random.value(0,1000)),
SYSDATE-ld
END LOOP;
END LOOP;
COMMIT;
END;
SELECT *
FROM
(SELECT DOMAIN_NAME,
QTD,
LOAD_DATE
FROM
(SELECT DOMAIN_NAME,
QTD,
LOAD_DATE
FROM SAMPLE_DATA
WHERE LOAD_DATE = TRUNC(SYSDATE-3)
ORDER BY QTD DESC
WHERE ROWNUM <=10
UNION ALL
SELECT 'Others' DOMAIN_NAME,
SUM(QTD) QTD,
LOAD_DATE
FROM
(SELECT DOMAIN_NAME,
QTD,
LOAD_DATE
FROM
(SELECT rownum rn,
DOMAIN_NAME,
QTD,
LOAD_DATE
FROM
(SELECT DOMAIN_NAME,
QTD,
LOAD_DATE
FROM SAMPLE_DATA
WHERE LOAD_DATE = TRUNC(SYSDATE-3)
ORDER BY QTD DESC
WHERE rn > 10
GROUP BY LOAD_DATE
ORDER BY QTD DESC
-- Result
DOMAIN_NAME QTD LOAD_DATE
Others 2888 24/03/13
DM_1 1000 24/03/13
DM_20 933 24/03/13
DM_11 913 24/03/13
DM_3 743 24/03/13
DM_13 572 24/03/13
DM_12 568 24/03/13
DM_9 564 24/03/13
DM_6 505 24/03/13
DM_5 504 24/03/13
DM_2 480 24/03/13
Please, Help me get in one query this result using a range of date.
e.g
using LOAD_DATE BETWEEN '24/03/13' AND '25/03/13'
DOMAIN_NAME QTD LOAD_DATE
Others 2888 24/03/13
DM_1 1000 24/03/13
DM_20 933 24/03/13
DM_11 913 24/03/13
DM_3 743 24/03/13
DM_13 572 24/03/13
DM_12 568 24/03/13
DM_9 564 24/03/13
DM_6 505 24/03/13
DM_5 504 24/03/13
DM_2 480 24/03/13
Others 1948 25/03/13
DM_1 807 25/03/13
DM_8 764 25/03/13
DM_7 761 25/03/13
DM_11 656 25/03/13
DM_18 611 25/03/13
DM_17 523 25/03/13
DM_14 467 25/03/13
DM_19 447 25/03/13
DM_15 437 25/03/13
DM_6 380 25/03/13 Thank you in advance.I got the solution. Just sharing.
I used analytic functions that make my job easy.
Sample Data
DOMAIN_NAME QTD LOAD_DATE
DM_1 807 25/03/2013
DM_1 1000 24/03/2013
DM_2 226 25/03/2013
DM_2 480 24/03/2013
DM_3 244 25/03/2013
DM_3 743 24/03/2013
DM_4 48 25/03/2013
DM_4 413 24/03/2013
DM_5 164 25/03/2013
DM_5 504 24/03/2013
DM_6 380 25/03/2013
DM_6 505 24/03/2013
DM_7 761 25/03/2013
DM_7 212 24/03/2013
DM_8 764 25/03/2013
DM_8 308 24/03/2013
DM_9 354 25/03/2013
DM_9 564 24/03/2013
DM_10 214 25/03/2013
DM_10 367 24/03/2013
DM_11 656 25/03/2013
DM_11 913 24/03/2013
DM_12 37 25/03/2013
DM_12 568 24/03/2013
DM_13 332 25/03/2013
DM_13 572 24/03/2013
DM_14 467 25/03/2013
DM_14 87 24/03/2013
DM_15 437 25/03/2013
DM_15 450 24/03/2013
DM_16 238 25/03/2013
DM_16 299 24/03/2013
DM_17 523 25/03/2013
DM_17 143 24/03/2013
DM_18 611 25/03/2013
DM_18 145 24/03/2013
DM_19 447 25/03/2013
DM_19 464 24/03/2013
DM_20 91 25/03/2013
DM_20 933 24/03/2013 Top 11 QTD of DOMAIN_NAME per Data Range.
SELECT *
FROM
(SELECT DOMAIN_NAME,
QTD,
LOAD_DATE
FROM
(SELECT LOAD_DATE,
DOMAIN_NAME ,
QTD,
(DENSE_RANK() OVER (PARTITION BY LOAD_DATE ORDER BY QTD DESC )) AS RANK_QTD
FROM SAMPLE_DATA
WHERE trunc(load_date) BETWEEN '24/03/2013' AND '25/03/2013'
WHERE RANK_QTD <= 10
UNION ALL
SELECT 'Others',
SUM(QTD) AS QTD,
LOAD_DATE
FROM
(SELECT LOAD_DATE,
DOMAIN_NAME ,
QTD,
(DENSE_RANK() OVER (PARTITION BY LOAD_DATE ORDER BY QTD DESC )) AS RANK_QTD
FROM SAMPLE_DATA
WHERE trunc(load_date) BETWEEN '24/03/2013' AND '25/03/2013'
WHERE RANK_QTD > 10
GROUP BY LOAD_DATE
ORDER BY LOAD_DATE ASC,
QTD DESC
DOMAIN_NAME QTD LOAD_DATE
Others 2888 24/03/2013
DM_1 1000 24/03/2013
DM_20 933 24/03/2013
DM_11 913 24/03/2013
DM_3 743 24/03/2013
DM_13 572 24/03/2013
DM_12 568 24/03/2013
DM_9 564 24/03/2013
DM_6 505 24/03/2013
DM_5 504 24/03/2013
DM_2 480 24/03/2013
Others 1948 25/03/2013
DM_1 807 25/03/2013
DM_8 764 25/03/2013
DM_7 761 25/03/2013
DM_11 656 25/03/2013
DM_18 611 25/03/2013
DM_17 523 25/03/2013
DM_14 467 25/03/2013
DM_19 447 25/03/2013
DM_15 437 25/03/2013
DM_6 380 25/03/2013 -
Can not set data range for a numerical control
I want to set the maximum of data range to 5000, but it always went back to default value of 127.
WHy I can not change the data range? Thanka for explanations.
Message Edited by Dejun on 11-14-2007 11:47 PM
Attachments:
datarange.jpg 74 KBSo hit the 'Representation' button.
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be! -
I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
[ABCTABLE]
ABCORDER
ABCPART
ABCSERIAL
ABCDATE
[ZYXTABLE]
XYZORDER
XYZPART
XYZSERIAL
XYZDATE1
XYZDATE2Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
on this computer. There are no "Null" fields in either of the tables.
This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
[MSORDR]
MSORDER
MSPART
MSSERIAL
MSOPNDATE
11111111
4444444
55555
2/4/2015
22222222
6666666
11111
1/6/2015
33333333
6666666
11111
3/5/2015
This table has one order for every part number and every serial number.
[GLORDR]
GLORDER
GLPART
GLSERIAL
GLSTARTDATE
GLENDDATE
ABC11111
444444
55555
1/2/2015
4/4/2015
ABC22222
666666
11111
1/5/2015
4/10/2015
AAA11111
555555
22222
3/2/2015
4/10/2015
Post Query table
GLORDER
MSORDER
GLSTARTDATE
GLENDDATE
MSOPNDATE
ABC11111
11111111
1/2/2015
4/4/2015
2/4/2015
ABC22222
22222222
1/5/2015
4/10/2015
1/6/2015
ABC22222
33333333
1/5/2015
4/10/2015
3/5/2015
This is the SQL minus the between date join.
SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART);
Maybe you are looking for
-
I thought I saw a video on Apple's site showing that you could organize mail on the touch and it would show those changes on your computer. For example, if I delete a message on the touch, it will be deleted on my computer. Is this possible? It seems
-
ASA 5510 running out of 1550 byte blocks
Hi, I am having trouble with our ASA5510. After upgrading the internal memory from 256 MB to 1 GB and upgrading the firmware to 8.4.2 we are experiencing that the ASA is running out of 1550 byte blocks. When that happens it is not possible to connect
-
Talk Over - or similar - in Adobe Audition CS6
Hi, I´m a new user of Adobe Audition CS6. In the past, I used to edit with Cool Edit PRO, the "grandfather"... I have a question. I want to MIX 2 o more tracks, but I want to do this automatically. Is it possible? In some mixer, the mic input use a "
-
How to acquire images on labview 6.0 using matrox meteor card acquisition?
i've a matrox meteor card acquisition , i want to display images on labview interface.
-
Repaint calls being ignored/dropped
I have a UserPanel (extension of JPanel) which resides inside a JScrollPane. In response to keyboard input, this UserPanel moves around an image in the panelspace and scrolls the viewport to keep it centered. The problem is that when I make the repai