- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 4
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
11 Posted Topics
Re: Hi, a possible solution: [CODE]<head> <script> function CheckAndSubmit () { var message = ""; var userName = document.getElementById ("userName"); if (userName.value.length < 3) { message += "The name of the user must be at least 3 characters long!<br/>"; } var password = document.getElementById ("password"); var repassword = document.getElementById ("repassword"); if … | |
Re: Use the Date object and the onchange event: [CODE]<head> <script> function RecalculateElapsedTime () { var startHSelect = document.getElementById ("starttimehour"); var startMSelect = document.getElementById ("starttimemin"); var endHSelect = document.getElementById ("endtimehour"); var endMSelect = document.getElementById ("endtimemin"); // convert string values to integers var startH = parseInt (startHSelect.value); var startM = parseInt (startMSelect.value); … | |
Re: [CODE]<head> <script> function loadIframe () { var urlStr; urlStr = location.search.slice(1); if (urlStr.length == 0) { urlStr = "home.php"; } window.frames.myiframename.location = urlStr; } </script> </head> <body onload="loadIframe ()"> </body>[/CODE] Related links: [URL="http://help.dottoro.com/ljcdubqo.php"]search property[/URL], [URL="http://help.dottoro.com/ljetnrhv.php#slice"]slice method[/URL], [URL="http://help.dottoro.com/ljetnrhv.php"]String object[/URL] | |
Re: In JavaScript, object literals are instances of the Object object. For example: [CODE]var point = {x : 100, y : 50}; alert (point.x); // or point["x"] alert (point.y); // or point["y"][/CODE] point is an instance of the Object object and it has two properties (x and y). This example is … | |
Re: I have done some modifications in your code to become more readable and usable. Hielo has right, you have an additional item (/resource/resmgr/ad_Banner/ad3.jpg) in imgs1, I have removed it: [CODE]<head> <script type="text/javascript"> var imgDatas = [ {src: "/resource/resmgr/Ad_Banner/ad16.jpg", href: "http://www.adamscollision.com", alt: "Adams Collision"}, {src: "/resource/resmgr/Ad_Banner/ad13.jpg", href: "http://www.huntleyrealty.com", alt: "Huntley Realty"}, … | |
Re: Required modifications: - The innerText property is not supported by Firefox (the textContent property provides similar functionality in Firefox). In that case, the innerHTML property can also be used. - The event.srcElement property is not supported by Firefox, use the target and srcElement properties together. - The event.offsetX property is … | |
Re: Hi, you can access the parent window with the opener or the parent property: - if a document opens a page in a new browser window (for example, by an anchor element or the open method), then the opener property can be used in the child document to access the … | |
Re: I made some modification in your source code: - the following line: <select name="method" onChange= "showhidefield(document.getElementById('method').value)"> has been replaced to <select name="method" onChange= "this.value)"> The getElementById method returns the element with the specified id in the current document, so it returns null in that case. (Note that the getElementById method … | |
Re: You can retrieve the state of a checkbox with the checked property: [CODE=javascript] write.onclick = function() { // calculate total var total = 0; if (confs.checked) { total += 100; } if (confm.checked) { total += 80; } // and so on var message = '<strong>' + 'You requirements are:' … | |
Re: hi omega, some suggestions: - use the XMLHttpRequest object instead of the ActiveXObject. The ActiveXObject is only supported by IE while the XMLHttpRequest object is cross-browser - if you want to call the GetSong method periodically, you can use the setInterval method instead of the setTimeout method - call the … | |
Re: It is a similar example to the previous one created by Chokladkakan and it works in all commonly used browsers (Internet Explorer, Firefox, Chrome, Safari, Opera). [CODE=html]<head> <script language="JavaScript"> function AddSMTH () { var textarea = document.getElementById("test"); if (textarea.selectionStart === undefined) { // Internet Explorer // create a range from … |
The End.