JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old July 31st, 2003, 01:32 AM
sumicooldude sumicooldude is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 48 sumicooldude User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via Yahoo to sumicooldude
window.reload

Dear All,

i have created an asp page that contains some date, and to update that page ive create a popup update page, now the problem is when i update the page the contents are updated and the popup window closes but original contents on the main page remain there, and to view the changes i have to manually reload that page, i wud like to know that is there ne method by which i can auto reload my page only once after the pop up window closes

please help me

regards
Sumeet
__________________
the coolest one

Reply With Quote
  #2  
Old July 31st, 2003, 06:54 AM
EiSa EiSa is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Norway
Posts: 184 EiSa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 22 m 24 sec
Reputation Power: 6
Don't know much about Javascript, but if you do something with this script you can use it to refresh the main page. This script close the popup-window and refresh the parent window.

PHP Code:
<script language="JavaScript">
<!--
function 
refreshParent() {
  
window.opener.location.href window.opener.location.href;

  if (
window.opener.progressWindow)
        
 {
    
window.opener.progressWindow.close()
  }
  
window.close();
}
//-->
</script> 
Put it into your popup-page.

Reply With Quote
  #3  
Old July 31st, 2003, 08:14 AM
sumicooldude sumicooldude is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 48 sumicooldude User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via Yahoo to sumicooldude
thnx a lot buddy it did worked absolutely fine

now ive got 1 more question, i have a simple form in which i want the user to put date only in the format of (19-jul-03), if the user puts somethin else an error msg shud come.

can u help me with this, i'll be more than thankful to you guys

regards
Sumeet

Reply With Quote
  #4  
Old July 31st, 2003, 08:51 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
The best way to handle this is probably by using regular expressions, which are kind of a pain in javascript. Check out devguru.com as a reference guide for that. The other might be to do something akin to the following (which probably won't work out of the gate, but which should give you a starting point):

Code:

<script language="javascript">

function check_date(date){
    thedate=new String(date);
    parts=thedate.split("-");
    if(parts.length != 3){
        alert('You have not provided a date in dd-mmm-yy format!');
        return false;
    }
    dayflag=0;
    days=new Array('01','02',...'31');
    for(i=0; i<days.length; i++){
        if(parts[0]==days[i]){
          dayflag=1;
          i=days.length+1;
        }
    }
    monthflag=0;
    months=new Array('jan','feb',...'dec');
    for(i=0; i<months.length; i++){
        if(parts[1]==months[i]){
          monthflag=1;
          i=months.length+1;
        }
    }
    yearflag=0;
    years=new Array('99','00','01','02','03'...);
    for(i=0; i<yearss.length; i++){
        if(parts[2]==years[i]){
          yearflag=1;
          i=years.length+1;
        }
    }
    if(dayflag==0 || yearflag==0 || monthflag==0){
        alert('The date format you have specified is invalid and should be submitted as dd-mmm-yy.');
        return false;
    }
    return true;
}

</script>


Not very efficient code, but that, or something like it, would verify that the values submitted match values you've specified as suitable. Your best bet is to build form controls that regulate how the user inputs the date. It's poor user interface to expect someone to provide the date by typing in the format you prefer. Consider using one of the many calendar widgets or even simple select boxes to control data input. This also makes validation easier for you on the back end.

If you're using PHP or perl, you might also try validating the date server side by checking the value passed against a regular expression like /\d\d-\w\w\w-\d\d/i.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > window.reload


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway