473,513 Members | 3,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to stop user not click combo box untill value comes in combo box

254 Contributor
Hi

I am creating a website to find car of different make and model.for that i am using two combo box one for car make and other for car model. when user clicks car make combo box and selects say audi then its all model should come in car model combo box which is coming and for that i have used ajax. since it takes one or two second to come record in car model combo box so what i want that during that time user should not able to click that car model combo box.

actually i wanted to do in this way here is url for the link:www.buyacar.co.uk.
the same thing is happening under buy your ideal new car online section

how can i do this.
Aug 31 '09 #1
3 2266
gits
5,390 Recognized Expert Moderator Expert
you may create a transparent div with a zindex that 'overlays' your div in question. therefor you just need to retrieve the coordinates of the node you wnat to overlay and set the position of the overlaying div ... in case you already use any JavaScript framework there should be methods to make that quite easy ... otherwise we could create some code here together :)

kind regards
Aug 31 '09 #2
mukeshrasm
254 Contributor
Thanks gits!
I am not using any JavaScript framework and when that transparent div will be called. If you can give some example code to understand me better or any reference url where I can find it.
Sep 4 '09 #3
gits
5,390 Recognized Expert Moderator Expert
here is a quickly hacked, quite short and FF-tested version:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4.  
  5. function maskItem(id) {
  6.     var node   = document.getElementById(id);
  7.     var coords = getCoords(node);
  8.  
  9.     var mask = document.createElement('div');
  10.  
  11.     mask.style.backgroundColor = 'red';
  12.     mask.style.opacity         = '0.5';
  13.     mask.style.position        = 'fixed';
  14.  
  15.     for (var i in coords) {
  16.         mask.style[i] = coords[i] + 'px';
  17.     }
  18.  
  19.     node.parentNode.appendChild(mask);
  20. }
  21.  
  22. function getCoords(node) {
  23.     var coords = {
  24.         top   : node.offsetTop,
  25.         left  : node.offsetLeft,
  26.         height: node.offsetHeight,
  27.         width : node.offsetWidth
  28.     };
  29.  
  30.     return coords;
  31. }
  32.  
  33. </script>
  34. </head>
  35. <body>
  36.     <input type="text" id="myInput" value="foo"/>
  37.     <input type="button" onclick="maskItem('myInput');" value="mask item"/>
  38. </body>
  39. </html>
  40.  
the getCoords() method might need to be extended to retrieve the correct position and measures in IE, you might have a further look here ... even the mask's css could be adapted with using a transparent image with a progress indicator or whatever ... :)

kind regards
Sep 16 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1253
by: Phil | last post by:
As a new user, I was pleased I was able to build tables and connect them properly (I think), but am having one problem on forms. How does one go about creating a form, where on field on the form is a combo box, where the selections in that box are from a table? I selected Table/Query in Properties for the combo box field. When using the...
2
1959
by: Gustavo\ | last post by:
Hi, I have a combo box in a form. It has limit to list set to "yes", and I have declared a NotOnList event procedure to take care of adding a value not on the list. Now, my problem is that, even though when I enter a value not on the list it appropriately opens the form to add a new value, the pop-up that says "The text you entered...
1
2456
by: gabble | last post by:
Hi all, I'm trying to implement right-click functionality on the drop-down portion of a combo box. I want to show a context menu when the user right-clicks on an item in the dropdown list - I currently have this working, but as soon as the menu appears the dropdown portion of the combo box disappears. I would like this to remain visible...
8
3506
by: Matt Theule | last post by:
While stepping through an ASP.NET project, I found that data was being inserted into my database even though I was not stepping through the code that inserted the data. I have a single page with inline code. The page has a Datagrid, a textbox and a button. When the button is clicked, the value of the textbox is inserted into the table...
9
2871
by: TCORDON | last post by:
I have a user control that contains 2 image buttons, when you click one of them, both must change the image source, the thing is that the first time you click any one of them the page appears to do a postbak, but the image source or the image displayed does not change until I click one of the images a second time, why dows it take 2 clicks for...
10
1384
by: Rochdi | last post by:
Hi guys, I was trying to use the Click, GotFocus and LostFocus events for a textbox in VB.net but I couldn't find them in the events list like VB, where can I find them..!!? Thanks
3
3768
by: hary08 | last post by:
im doing a database for Hospital Admission, I have a log in form which prompt user for a password. The source of log in is to look for the values in my Table tblEmployees and match user name and password entered.My case now is I have Audit Trail Module which keeps records of modifications and current user, I wanted my audit trail to log the...
5
1727
by: MLH | last post by:
I have a vehicle entry form with a combo box for choosing the owner. Let's say the user opens the list by clicking the arrow then choose the owner by clicking a name. That much works fine. But the problem begins here... If for some reason, the user is uncertain of his first choice of an owner and decides to drop the list down again, using...
1
1860
by: commodityintelligence | last post by:
Greetings, I am merging a series of different tables into one query to export decision-making information. I have some architecture issues I need to ask for help on. I have no programming training. I will explain my structure before asking my questions. I have data from a table (updated monthly by adding the most current month’s data)...
0
7177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7394
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
5701
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4756
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3237
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.