Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Javascript - alert dialog box and text box

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(1)Is it possible to specify the x,y possition of the alert dialog box?
(2)I have a text box in a form. If the user clicks 'submit' without entring anything in the text box, I am able to pop up the alert dialog box. But if the user clicks in the text box, enters spaces and then clicks submit, I am not able to pop up the dialog box. How do you make a check that the textbox is empty when spaces are entered.
Thanks,
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1: i dunna know
2: yes, but im going to bed now so im not going to explain it
[This message has been edited by Ruyard Kipling (edited April 26, 2001).]
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well basically you have to do something like what the trim function does in Java..and what it does is it removes whitespaces from both ends of a string and if the length of the string after trim is 0 you know it was all spaces...i am not sure if javascript has a built in function that does it you will have to construct your own which removes white spaces from a string...i have it somewhere if u really really need it let me know i'll paste it here
-manav
 
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. 99.999% sure you can NOT position the alert box. If it is that important, put it in a small pop-up window, you can control all kinds of things that way.
2. Here is some sample code for checking blank entries...

Here is the Form:

Be forewarned though, I've been having problems with NS4.x not always liking the ".value" functions, (MSIE and NS6 work just fine), but this code in particular has worked for me in all the browsers.
Good Luck.

------------------
I'm a soldier in the NetScape Wars...
Joel
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
If you like to know more about it,you can take a look at this
http://developer.netscape.com/docs/examples/javascript/formval
Deepa

------------------
 
Whose rules are you playing by? This tiny ad doesn't respect those rules:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic