|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
hi friends,
i had a select menu in which i am disaplaying some items. So if i select any other item(when the value other than previous one is selected) then a pop up appear there he is given a warning whether he wants to change the item in the select box with the changed one with OK/Cancel. if he selects ok then new value should be selected in the select box , if cancel is pressed then i require the previous value being displayed i.e before the onchange being fired. Thanks in advance....... I am eagerly waiting for ur suggestions..... Bye...... Ravindra........ |
|
#2
|
||||
|
||||
|
Here's a super quick and dirty example; it works =)
Code:
<html>
<body>
<select id="selectList" onchange="validateChange(this)">
<option>Apples</option>
<option>Oranges</option>
<option>Bananas</option>
</select>
<script language="javascript">
var selected = 2;
selList = document.getElementById('selectList');
selList.options[selected].selected = true;
function validateChange(sel) {
if (!confirm("Are you sure you want to change?"))
sel.selectedIndex=selected;
}
</script>
</body>
</html>
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Wanted some information on select tag |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|