File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes please help Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "please help" Watch "please help" New topic
Author

please help

dhriti joshi
Ranch Hand

Joined: Aug 13, 2002
Posts: 82
hi,
i have a list of input boxes.
i want that user can make change only in any one of them.
if value for second is tried to change get an alert.
how can i do that.
thanks,
dhriti.
brad balmer
Ranch Hand

Joined: Mar 08, 2004
Posts: 57
Add some javascript:
In the onchange="" call a function looking to see if an attribute value has already been changed from false to true;
<script>
var changed=false;
function changed() {
if(changed == true)
return false;
else {
changed = true;
return true;
}
</script>
Now, don't quote me exactly on the javascript above, but something like that.
Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 451
This looks a javascript problem (not jsp).
You can define a global flag in javascript. Whenever user makes changes in any of the input set that flag to true. Also before applying the changes see if the flag is not already true, if it is already true give an alert.


Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50677

Moved to the HTML/Javascript forum.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
dhriti joshi
Ranch Hand

Joined: Aug 13, 2002
Posts: 82
Hi Brad,
this gives me a message after i change the value.
how can i get a message before changing second value.
thanks,
dhriti.
 
 
subject: please help
 
Threads others viewed
Career Change
changing oas listener port
Change size of progress monitor
Live Object Method Change
JPanel
developer file tools