Jump to content

aspnetguy

Members
  • Posts

    6,787
  • Joined

  • Last visited

Everything posted by aspnetguy

  1. I have found the 'vector' it is a c++ dynamic array like ArrayList in C#This solves my problems
  2. You can create a control like this Label lblMyLabel = new Label();lblMyLabel.ID = "label1";lblMyLabel.Text = "I'm a label!"; You then can add it to the page with Controls.Add(lblMyLabel); I have never added dynamic contorls to a table before but I imagine it would be something like this myTable.Cells[index].Controls.Add(lblMyLabel) //I'm guessing on this
  3. aspnetguy

    Primary KEY by Query

    I don't think you can.Why do you need to?
  4. You will need to use INNER JOIN, you should read about GROUP BY as well, you may need it. SELECT t1.c1,t2.c3FROM table1 t1INNER JOIN table2 t2ON t1.c1 = t2.c1
  5. Based on this code you posted And if you want to display the description to the screen you will have to do thisSELECT av.Description,cs.CS_DescriptionFROM avINNER JOIN csON av.Omim_No=cs.Omim_NoWHERE av.Description LIKE '%LIVER%'OR cs.CS_Description LIKE '%LIVER%' in order to add more tables do this. SELECT av.Description,cs.CS_Description,nt.descriptionFROM avINNER JOIN csON av.Omim_No=cs.Omim_NoINNER JOIN newTable ntON av.Omim_No = nt.Omim_No -- assuming newTable has Omim_NoWHERE av.Description LIKE '%LIVER%'OR cs.CS_Description LIKE '%LIVER%'OR nt.description LIKE '%LIVER%'
  6. So I want to assign a onchage event to my object, i tried this var SelectBox = new DropDownList(document.getElementById('selectList'));function DropDownList(obj){ this.Items = obj.options; ... this.onchange = function(){}} but it thinks I am trying to create a onchange method for the object.so I tried this var SelectBox = new DropDownList(document.getElementById('selectList'));function DropDownList(obj){ this.Items = obj.options; ... obj.onchange = function(){this.SelectedIndex = obj.selectedIndex}} But in this context (inside the onchange function) this is refering to the obj because I am defining the onchange for obj and obj (select tag) does not have SelectedIndexIs there a way to attach an onchange event (or an event for that matter) to the object (this.onchange)
  7. Wow that sounds awesome. I would pay for that just to get 'relavent' results on searches and not get spammed and killed with popups.
  8. Thanks for the suggestions, I am in another C++ forum right now but the answer has not yet come.I may have to resort to emailing an old teacher.
  9. Thanks Blue your code does work, but I have discovered that that was not the problem. The problem was adding Items dynamically. Everytime a item is added the Items array needs to be updated.It is proving more difficult than I had hoped so I will have to settle for SelectBox.Items.Remove(index);Thanks everyone
  10. this should work<a href="java script:history.back()">Please try again</a>or document.write('<a href="java script:history.back()">Please try again</a>');
  11. That indeed does work however I am still hoping to find a way to attach a Remove() to the individual options of the Items array.I really want to be able to do thisSelectBox.Items[someindex].Remove();I really want to know why I get an erro when attching a method to the Items array
  12. I realize that would work but the whole point of creating the new object is to use it for all methods.I could have easily done all the stuff in my code without the new object and did what you did .I am looking to make the functionality easier to use and have added some features that don't exist in select, like SelectedValue.
  13. That is not what I want to do.I want ot be able to writeSelectBox.Items[2].Remove() and have it delete the option at index 2.it is not letting me add methods to the array for(...){ this.Items[i].Remove = function(){...}} this.Items = selectTag.optionsso I want the function to bethis.Items.Remove = function(){selectTag.options = null}Any ideas,I really want ot use the Remove function with Items[]
  14. I have created a new <select> object called DropDownList.I have no trouble adding methods to parts of this object like <html><head><script> var SelectBox; onload= function Page_Load() { SelectBox = new DropDownList(document.getElementById('selectBox')); SelectBox.Items.Add('Choose Option',''); SelectBox.Items.Add('Zero','0'); SelectBox.Items.Add('One','1'); SelectBox.Items.Add('Two','2'); SelectBox.Items.Add('Three','3'); SelectBox.Items.Add('Four','4'); SelectBox.Items[0].Remove(); //THIS LINE CAUSES ERROR } //DropDownList object function DropDownList(obj) { //if obj doesn't exist if(!obj) { var obj = document.createElement('select'); document.body.appendChild(obj); } //ddl ID this.ID = obj.id; //if ddl is empty avoid error //by adding temp option if(obj.options.length == 0)obj.options[0] = new Option('','temp'); //ddl selected index this.SelectedIndex = obj.selectedIndex; //ddl value of selected index this.SelectedValue = obj.options[obj.selectedIndex].value; //ddl text of selected index this.SelectedText = obj.options[obj.selectedIndex].text; //Items array this.Items = obj.options; //number of Items in ddl this.Items.Count = obj.options.length; //clear ddl array or just specified index this.Items.Clear = function(index) { if(index == null) obj.options.length = 0; else obj.options[index] = null; } //Value and Text properites for(var i=0;i<obj.options.length;i++) { this.Items[i].Value = obj.options[i].value; this.Items[i].Text = obj.options[i].text; this.Items[i] = obj.options[i]; this.Items[i].Remove = function(){obj.options[i] = null}; //ERROR } //remove temp option if(obj.options[0].value == 'temp')obj.options.length = 0; //add Items to ddl this.Items.Add = function(txt,val){obj.options[obj.options.length] = new Option(txt,val)} }</script></head><body><select id="selectBox"></select></body><html>
  15. if I do this #include <iostream>using namespace std;int main(){ int i; int arr[4]; arr[0] = 5; arr[1] = 10; arr[2] = 15; arr[3] = 20; int len = sizeof(arr)/sizeof(arr[0]); for(i=0;i<4;i++) { cout << arr[i] << endl; } cin.get(); return 0;} len equals 4 (the size of the array) like it should.Let me point out I am doing this because c++ arrays have no function to get the length of the array except sizeof(arr)/sizeof(arr[0]). So I want ot write a function to handle this.If I do this #include <iostream>using namespace std;int ArrayLength(int[]);int main(){ int i; int arr[4]; arr[0] = 5; arr[1] = 10; arr[2] = 15; arr[3] = 20; int len = ArrayLength(arr); for(i=0;i<4;i++) { cout << arr[i] << endl; } cin.get(); return 0;}int ArrayLength(int theArray[]){ return sizeof(theArray)/sizeof(theArray[0]);} len equals 1. It is like theArray[] is not getting the contents of arr and is declaring a new array or something.I am just starting to learn c++ and if anyone can explain this it would be a big help because I pass arrays to functions alot and need to know how to do it the right way. Thanks,
  16. you can do that with a server side language. Select the names starting with s then do string manipulation and then update the records again.
  17. your questions are very vague. Where is omim number?? What do you mean link to another table.What do you want to do (specificly) with the data returned from your select statement???
  18. aspnetguy

    Insert into

    I don't think that is hte correct syntax, You could write multiple insert statements in a stored procedure then execute the stored procedure when you want to insert multiple records.
  19. maybe this will helphttp://www.xav.com/scripts/axs/help/2002.html
  20. It sounds like the redirect is not the problem at all. It has something to do with the perl compiler.For whatever reason Netscape and FireFox are not recognizing the cgi script and thus trying to download it.I have had this happen when I didn't have the php compiler installed properly except all browsers did this not just a few.I wish I had some better ideas for you but I would start looking at the server configurations to ensure the compiler is setup correctly. You may also want to check if firefox manages file extensions or something.Chances are if you solve it for either NN or FF it will automatically correct the other since Netscape 6+ and FireFox (Mozilla) both run on the Gecko browser engine.
  21. Could you explain the situation a little more, I am not quite understanding your situation fully.
  22. using obj.disabled = true;or obj.disabled = false;works in all browsers
  23. the div will be 230px wide but will take up 250px because of the 10px margin on each side
  24. Actually it would be like this var obj = document.getElementById('idGoesHere');obj.onmouseover = function(){this.className='classForMouseOver'}obj.onmouseout = function(){this.className='classForMouseOut'}
×
×
  • Create New...