Re: OT: Javascript Alert SOLVED

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 57972
interpreted = N
texte = The alert should read as follows: alert ("Banner ads must keep the original file name:\n" + oldBanner); On 5/21/04 11:36 AM, "Clint Davis" wrote: > I want to compare an existing file name to the filename of a pulldown menu > selection of file upload. If they don't match, the alert should be > activated. > > Here's my code as it stands now. The +oldBanner+ appears in the alert as > text instead of substituting the variable name. > > > for(i=0;i { > var oldBanner = 'BannerAd-1.gif'; > var elem = document.forms[0].elements[i]; > if (elem.name == "theFile1") > { > if (elem.value == "" && theForm.____BANNERIMG.value == "") > { > alert ("Please select banner."); > theForm.____BANNERIMG.focus(); > return (false); > } > if (elem.value != 'oldBanner' && theForm.____BANNERIMG.value != 'oldBanner') > { > alert ("Banner ads must keep the original file name.\n+oldBanner+"); > theForm.____BANNERIMG.focus(); > return (false); > } > } > } ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: OT: Javascript Alert SOLVED ( Clint Davis 2004)
The alert should read as follows: alert ("Banner ads must keep the original file name:\n" + oldBanner); On 5/21/04 11:36 AM, "Clint Davis" wrote: > I want to compare an existing file name to the filename of a pulldown menu > selection of file upload. If they don't match, the alert should be > activated. > > Here's my code as it stands now. The +oldBanner+ appears in the alert as > text instead of substituting the variable name. > > > for(i=0;i { > var oldBanner = 'BannerAd-1.gif'; > var elem = document.forms[0].elements[i]; > if (elem.name == "theFile1") > { > if (elem.value == "" && theForm.____BANNERIMG.value == "") > { > alert ("Please select banner."); > theForm.____BANNERIMG.focus(); > return (false); > } > if (elem.value != 'oldBanner' && theForm.____BANNERIMG.value != 'oldBanner') > { > alert ("Banner ads must keep the original file name.\n+oldBanner+"); > theForm.____BANNERIMG.focus(); > return (false); > } > } > } ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Clint Davis

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WCf2 and nested tags (1997) Warning: 50 [MATH] Variable Limit per page (1998) On a related topic (2006) add to cart within a page? (1997) Can you do this??? and other stuff (1997) Nesting [RAW] (1998) Oops, my mistake - (was Bad suffix error) (1997) dbs in globals or site folder (2005) GuestBook example (1997) Emailer port change (1997) Not really WebCat (1997) Message Board (2001) Is this possible, WebCat2.0 and checkboxes (1997) Need formum software... (2003) WebCommerce: Folder organization ? (1997) Pithy questions on webcommerce & siteedit (1997) Cart contains # (2000) upgrading (1997) [SearchString] problem with [search] context (1997) Snake Bites (1997)