Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. jesh

    Problems with textbox.

    Well, if you want to go the easy route:.ASPX <form runat="server" id="UserForm"><asp:TextBox id="EmployeeID" runat="server" /><asp:Button id="SubmitButton" runat="server" OnClick="SubmitButton_Click" Text="Submit" /><asp:TextBox id="EmployeeName" runat="server" Visible="false" /></form> .ASPX.CS protected void Page_Load(object sender, EventArgs e){}protected void SubmitButton_Click(object sender, EventArgs e){ int _employeeID; int.TryParse(EmployeeID.Text, out _employeeID); // _employeeID now has the integer value of the employee id // entered by the user. Use that integer to get the data from the database // once you have the data you can set the value to your EmployeeName text box: EmployeeName.Text = _employeeName; EmployeeName.Visible = true;} If you want to go the AJAX route, head over to the AJAX tutorial here: http://www.w3schools.com/ajax/default.asp
  2. jesh

    IE Bug?

    I think the problem is here: #menu li, ul { ... font-size:16px; ...} It's been my experience that IE doesn't like to resize text when it has been specified using pixels. Try change that style declaration to something like: #menu li, ul { ... font-size: large; /* or use medium */ ...}
  3. jesh

    Problems with textbox.

    It's not too bad if you take it one step at a time. First, you might figure out where that data is going to be coming from. If it's going to be coming from an XML file, then you'll want to look around for some tutorials about how to load XML files and read their data.If it's going to be coming from a database, check out how to set up databases. Once the database is set up, look for tutorials about making a connection to the database and retrieving data.Projects are definitely difficult and confusing when you first approach them, especially when you are learning a new technology. Just take it one step at a time and you'll get there.
  4. Not to mention that they recently acquired Verisign. PayPal is one of the leaders in online financial transactions.https://www.paypal.com/cgi-bin/webscr?cmd=x...isition-outside
  5. That sounds right. If $ref stores the URL to the previous page, then using something like this should work:echo '<a href="$ref">Back</a>';
  6. jesh

    Problems with textbox.

    In order to populate those fields with data from some data source (e.g. a database), you'll have to make a call to the server. The easy way would be for the user to type in a value into the employee ID box and hit submit to post the request back to the server. Then, on the server, check that value against the data source and populate the other two text boxes with that data and send the response back to the user.A more challenging way is to use AJAX to send that request to the server so the user doesn't have to submit the entire page.This article (http://www.codeproject.com/aspnet/GoogleSuggestDictionary.asp) may help get you started.
  7. jesh

    PHP script

    Hah! You must have studied (or are studying) science to know that there are 365.242199 days in a year. :)The only thing I see right away is that you misspelled label as "labal":
  8. jesh

    Overflow Width

    Let's say, for example, you have the following page: <html><head><style type="text/css">#test{ width: 300px; overflow: hidden; white-space: nowrap;}</style></head><body><div id="test"> this content is designed to overflow the width of this containing div. this content is designed to overflow the width of this containing div. this content is designed to overflow the width of this containing div. this content is designed to overflow the width of this containing div.</div></body></html> This renders out so that only part of the content is visible in the browser; the rest is clipped off. Everything is peachy.My question is: Does anyone know of any property in the DOM that I can get at with javascript that will tell me A: whether the content actually overflowed or B: how wide the content inside the container would be if it wasn't clipped?I'm having a hard time wording my Google searches this morning and I'm not getting any results.
  9. jesh

    removing nodes

    Ah, yeah, that's another way to do it: <div id="myDiv" style="display: none;">Some text that isn't seen right away.</div> document.getElementById("myDiv").style.display = "block";
  10. No problem. I think in this case, a series of if/thens will work for you since you only want something to happen if a certain condition is met - the else in this case is "do nothing".
  11. Check out lightbox and see if you can apply it to your project:http://www.huddletogether.com/projects/lightbox/Or check out thickbox:http://jquery.com/demo/thickbox/
  12. Hmm. This may work for your situation.If you had the following HTML: <body> <iframe id="frame1"></iframe> <iframe id="frame2"></iframe></body> And you wanted to have a link in frame1 open up in frame2, you could code the link something like this: <a href="link.html" onclick="window.parent.document.getElementById('frame2').src = this.href; return false;">Link</a>
  13. Something like this? TextBody = ""if Postcode <> "" then TextBody = TextBody & "Postcode: " & Postcode & VbCrLfif Contact_Telephone_No <> "" then TextBody = TextBody & "Contact_Telephone_No: " & Contact_Telephone_No & VbCrLf If I've got "does not equal" incorrect (<>) I apologize, I don't know how to do that in VB.
  14. jesh

    print

    This link may help. I only read the title () so I can't comment on the contents, but it may help.Emailing the Rendered Output of an ASP.NET Web Control in ASP.NET 2.0http://aspnet.4guysfromrolla.com/articles/122006-1.aspxEDIT: Here's another link:http://www.devhood.com/tutorials/tutorial_...tutorial_id=758
  15. No, it won't.I haven't tried this, mainly because I don't have too many opportunities to work with iframes, but you might try something along the lines of this (partly taken from http://xkr.us/articles/dom/iframe-document/):// Get a reference to your iframe element.var iframe = document.getElementById("myIFrame");// Next, get a reference to the iframe's document elementvar doc = iframe.contentWindow || iframe.contentDocument;if(doc.document){ doc = doc.document;}// Next, (haven't tested this), get the height of the documentvar height = doc.offsetHeight;// Finally, set the height of the iframe.iframe.style.height = height + "px"; If that code works, then the only trick left would be to have that code execute each time the iframe's src changed (i.e. when a user clicks on a link to change the iframe).I hope it helps.
  16. I would probably set it up with two tables: Products and ProductSizes.Products: ProductID ProductName ProductDescriptionProductSizes: ProductID ProductWidth ProductHeight ProductDepth ProductWeight ... you get the idea ...Then, you would have one entry for each product in your Products table and you could have as many Sizes for each product that you needed in the ProductSizes table. The query to get the sizes in this situation would be something like: SELECT * FROM ProductSizes WHERE ProductID = 345; Otherwise, to answer the question for your current setup, the query could look something like this: SELECT * FROM products WHERE productname LIKE 'Some Product Name';
  17. I think Firefox disables, by default, the ability to use javascript to modify the status bar in the browser. Perhaps you could use document.title to modify the browser title: document.title = "Some new window title."; Otherwise, the better idea may be to add a div to your page that contains that loading message rather than relying on changing the status bar or the title.HTML <div id="LoadingMessage"></div> javascript var div = document.getElementById("LoadingMessage");div.innerHTML = "Loading....";
  18. When I was first learning about DHTML and using javascript, CSS, and the DOM to make things slide and bounce around on the screen, I turned towards Dynamic Drive to get some ideas. They have a ton of scripts there. Maybe one of them is close to what you need and you can look at the source to see if you can determine how they accomplished it.Here's the link: http://www.dynamicdrive.com/
  19. Using the Web Developer extension for Firefox, I was able to outline all block level elements on the page to see that the problem appears to be that your tekstballon element is too big. When you mouse over the div, the tekstballon becomes visible underneath the mouse cursor so the mouseout event on the div fires which makes the tekstballon disappear which causes the mouseover event on the div to fire. This is repeating ad nauseum and is the cause of your flickering.Try throwing a border on the tekstballon element to see what I'm talking about. I think the solution will be to make that element only as big as it needs to be to display the bubble.
  20. You can use the DOM to set the height in java script:HTML <iframe id="myIFrame"></iframe> javascript (option 1) document.getElementById("myIFrame").height = "400"; javascript (option 2) document.getElementById("myIFrame").style.height = "400px"; Check out the DOM tutorial for more information:http://www.w3schools.com/htmldom/prop_iframe_height.asp
  21. It's hard to tell because of the way the script is formatted. But, without looking at the javascript, I noticed this pearl in the CSS: FILTER: progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=0.20,wipestyle=0,motion=forward,duration=2); As far as I know, filters only work in IE. This may explain your problem.
  22. After some searching around to see why I didn't know about the Enumerator object in javascript, I discovered that it isn't part of javascript. It's part of Microsoft's JScript so it'll only work in IE.Another way to do what aalbetski posted could be like this: function CheckCheckBoxes(){ var re = new RegExp("^email_"); var inputs = document.getElementsByTagName("input"); var input; for(var i = 0; i < inputs.length; i++) { input = inputs[i]; if(input.type == "checkbox") { if(input.id.match(re)) { input.checked = true; break; } } }}
  23. I'm not totally certain what you are trying to accomplish, but if you want to introduce a delay before your "textbubble" disappears, you can use setTimeout:function antitextbubble(){ // Setting the display to none will happen 5000 milliseconds // (5 seconds) after this code executes. setTimeout("document.getElementById('textbubble').style.display='none';", 5000);} If that's not the answer you're looking for, maybe you could present us with all the code - I didn't see the "textbubble" element in your post.
  24. It had been a few months since I was faced with dynamically creating a drop down menu using the DOM so I turned (as I always do) to the tutorials on the site - specifically here:http://www.w3schools.com/htmldom/met_select_add.aspThe solution, as it is presented, doesn't work cross-browser. I suggest updating it to something like this:BEFORE: function insertOption() { var y=document.createElement('option'); y.text='Kiwi' var x=document.getElementById("mySelect"); try { x.add(y,null); // standards compliant } catch(ex) { x.add(y); // IE only } } AFTER: function insertOption(){ var y = document.createElement('option'); y.appendChild(document.createTextNode('Kiwi')); var x = document.getElementById("mySelect"); x.appendChild(y);} This way it'll work, at least, on the PC using Firefox 2.0, IE 6.0, Opera 9.1 and on the Mac using Firefox 1.5 and Safari (didn't check the version). The solution, as currently presented, doesn't work at all in Safari.
  25. jesh

    onload event

    The event happens first.Don't know if this applies to your situation or not, but you can stop the page+URL from changing by returning false in the onclick handler code:<a href="#info" onclick="somefunction(); return false">Info</a> In this example, only "somefunction()" would fire. The browser would not see the request to navigate to the #info anchor because we returned false out of the click handler. The way you might use this in your application could be like this: <a href="#info" onclick="somefunction(this.href); return false">Info</a> Then, rather than looking at the location.href or location.search to get the "#info", you can simply pass it into the function as a parameter.Hope this helps.
×
×
  • Create New...