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:

WebCat2b15MacPlugin - showing [math] (1997) BinaryBody problem ...... (2003) Physical Security for WebCatalog Directories (1997) How to append text after the sign & (1997) Max Record length (1997) form posts expiring instantly... why? (2000) Redirect (2003) Displaying photo attached to first record (1997) Monthly Reports (2000) f2 download problems (1997) orders being printed (1998) Size limit for tmpl editor ? (1997) Shopping problems with 2.1b3 acgi (1997) Resending - Please help (1999) Replace context problem ... and answers (1997) ImageMagick (2003) Nested tags count question (1997) webcat- multiple selection in input field (1997) RE: Error: template (1997) default value from Lookup (was Grant, please help me) (1997)