270 Posted Topics
Re: [CODE]window.onload = function () { window.moveTo(0, 0); window.resizeTo(screen.availWidth, screen.availHeight); }[/CODE] works in IE, Firefox, Safari. Workaround(s) may be available for Opera and/or Chrome. | |
Re: [QUOTE]validation Javascript loads after the form actually displays?[/QUOTE] Placing the <script> just before the </body> tag will do what you want but it is not likely that doing so will, by itself, significantly improve the perceived load time. Something else is almost certainly going on. | |
Re: I can't help with the AJAX syntax - sorry - but this post [url]http://www.daniweb.com/forums/post1213631.html#post1213631[/url] shows how to unhide/hide related elements as the <option> in a <select> list changes using only javascript with CSS. | |
Re: When the URL is in another domain the underlying XMLHttpRequest will never succeed in some browsers and in others it may be blocked by security settings. | |
Re: [QUOTE=blud;1216951]this happens every time she changes it, a few people say it sucks, then everyone gets used to it[/QUOTE] Not "everyone". Some will silently leave and others will never join (or at least stay) in the first place. | |
Re: [QUOTE]pass the value from the textbox to the parent page[/QUOTE] Here is a non-IE solution. Cross-browser version to follow. This is demo.html (a toy page with a div to be changed) [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 25 March 2009), … | |
Re: If the theme is done properly in css, use a browser with the ability to override style sheets. The IE setting (in Appearance [Accessibility]) and the Safari(PC) setting (Prefences [Advanced]) seem to be all-or-none. ISTR some browser having per-site customization but I don't see it at the moment. | |
Re: Yes. To assign a class [CODE]obj.className = 'myclass'[/CODE] To add a class [CODE]obj.className += ' myclass' // NOTE the leading blank[/CODE] Existing class(es) can also be removed. To refer to the row in question use something like [CODE]var obj = document.getElementById('myspecialrow')[/CODE] or in the more general case [CODE]var obj = … | |
I'm hoping that I may be able to persuade the PTB that 'mark as solved' should be a button ("this post solved my problem") associated with a message [just like "post reply" and - I'm hoping - just below it). My short run goal is to increase the utilization rate. … | |
Re: Here is a little toy [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org"> <title></title> <style type="text/css"> div {float:left; height:100px; width:100px} </style> <script type="text/javascript"> </script> </head> <body> <div onmouseover="this.style.width='200px'" onmouseout="this.style.width='100px'" style="background-color:red"></div> <div onmouseover="this.style.width='200px'" onmouseout="this.style.width='100px'" style="background-color:green"></div> <div onmouseover="this.style.width='200px'" onmouseout="this.style.width='100px'" … | |
Re: My preference would be a button instead of a link, in a somewhat distinctive but not jarring color, preferable near the 'flag' and 'post' buttons. | |
Re: [ICODE] elements=data.getElementsByTagName('element'); for (i = 0; i < elements.length ; i++) [/ICODE] The comparison in the for statement was miscoded. | |
Since the makeover, when entering a thread with "Go to last post" the browser 'back' button is not available. This does not happen in Firefox. | |
Re: All you need is something like this [CODE]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org"> <title> jeje </title> <meta http-equiv="Content-Type" content= "text/html; charset=us-ascii"> <script type="text/javascript"> function popup(uri,height, width){ newwindow = window.open(uri,'333','height='+height+',width='+width); newwindow.focus(); } </script> </head> <body> … | |
Re: You might try a better DOCTYPE and/or run your page(s) through a validator. | |
Re: [B]cant i pass variable clear[/B] To be passed in this way, the variable must be global (declared without var) [CODE]function interval_setting() { _clear = 0; _clear = setInterval("xmlhttpPost11('index.cgi','tracker_shower','Latest_frame','Tracker_loader',_clear,'','','')", 20000); }[/CODE] | |
Re: [CODE] var now = new Date(); [/CODE] [B]display the timestamp[/B] This [CODE]document.getElementById('show').appendChild(document.createTextNode(now))[/CODE] is all you need to display the timestamp in this [ICODE]<div id='show'></div>[/ICODE] Beyond that, everything [the format, the style, the placement, etc., etc.] is negotiable. | |
Re: The problem is that document.write cannot be used with setInterval(). Use something like this [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org"> <script type="text/javascript"> function timewaster() { document.getElementById("out").appendChild(document.createTextNode("x")); } </script> <title></title> </head> <body> <div id="out"></div> <script … ![]() | |
Re: Get the element in any convenient way [CODE]var oEL = document.getElementById('id');[/CODE] and remove it [CODE]oEL.parentNode.removeChild(oEL);[/CODE] | |
Re: prompt var userinput validate [do nothing if null; error/reprompt if invalid] [CODE] var oTD = document.getElementById('targetdiv') var eNA = oTD.appendChild(document.createElement("a")); eNA.setAttribute("href", userinput); eNA.appendChild(document.createTextNode(userinput));[/CODE] Step4 could insert text of your choosing instead of repeating the uri. | |
Re: [CODE] <input type="button" name="Add_OpStds_Step" id="Add_OpStds_Step" value="Add Step" onclick="Add_OpStds_Step();" /> [/CODE] The problem is that the button [ICODE]name="Add_OpStds_Step" [/ICODE] string is the same as the name of the onclick= function. Remove it or change it to anything else. | |
Re: [QUOTE=KPooja;1216627] box must overlap adjecent combo, not expand the window [/QUOTE] [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org"> <style type="text/css"> #box1 { width:400px; height:300px; background:#F00; position: absolute; left: 0in; } #box2 { width:400px; height:300px; background:#0F0; position: … | |
Re: [QUOTE=jellybeannn;1216411]Thanks I get a value now, but it is the wrong value.[/QUOTE] The second for loop in this demo [CODE]<html> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org"> <title></title> </head> <body> <table> <tr> <td> <input name="rate"> </td> <td> <input name="area"> </td> <td> <label></label> </td> … | |
Re: Where supported [icode]object.setRequestHeader(sName, sValue)[/icode] | |
Re: [QUOTE=mohanvamsi_18;1213558] First I corrected this [B] // Here not working e3s1.onselect = function() { checkother(); };[/B] to [CODE]e3s1.onchange = checkother; // function() { checkother(); };[/CODE] Then in order to test I had to fix several typos in what you posted and add my own 'checkother' function. I would have helped … | |
Re: [QUOTE=phoenix_dwarf;1215161] loop through a listbox [/QUOTE] [CODE] var oLB = getElementById("boxname") for (var i = 0; i < oLB.options.length; i++) { ... process oLB.options[i].value ... }[/CODE] | |
Re: [QUOTE=loveisblind;1214667] add a Candidate text field just relevant to that Office/Position [/QUOTE] This [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org"> <title></title> </head> <body> <form> <input id="IT"> </form> <script type="text/javascript"> var oITnew = document.createElement("input"); oITnew.setAttribute("value","added"); var … | |
Re: [QUOTE=gskoli;1212693] [CODE] for(var m = 10;m<no_of_rows;m++){ document.getElementById(table_id).deleteRow(m);// HERE MIGHT B THE ERROR [/CODE][/QUOTE] Deleting row m and then incrementing m skips rows (and causes m to exceed the number of rows in the [reduced] table). One fix is to delete row 10 n times (n=no_of_rows-max); another is to start m … | |
Re: [QUOTE=Nickg140143;1208684] [CODE] if (validate_fullname()==false|validate_email()==false|validate_zipcode()==false|validate_phonenumber()==false) {return false;} else {return true;} } [/CODE] [/QUOTE] You want the .test method (not an == comparison). Individual tests should look something like these [CODE] var emailRE=/^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/ if (!emailRE.test(theForm.FieldData1.value)) { //1=Email alert("The 'Email' is not valid."); theForm.FieldData1.focus(); return (false); } var phoneRE=/^(\d{3}-){1,2}\d{4}$/ if (!phoneRE.test(theForm.FieldData2.value)) { //2=Phone … | |
Re: [QUOTE=samarudge;1213815] Why is it only doing this in IE [/QUOTE] This might help [url]http://www.permadi.com/tutorial/flashGetObject/[/url] although given the apparent age of that page it might now be a better strategy to start with getElementById() [instead of ending up with that]. | |
Re: [QUOTE=MDanz;1213178] [ICODE] onClick='return changeAction1(this);' [/ICODE] [/QUOTE] I think that should be [ICODE] onclick="changeAction1(this);return true" [/ICODE] but that still isn't quite right: 'this' refers to the <input> element (for which no action= is defined). ![]() | |
Re: [QUOTE=Erco21;1212031] how to make a button to do something when clicked. [/QUOTE] Either include the onclick="" event attribute in the button definition or assign something to the .onclick property of the button. [QUOTE] my button is awfully small [/QUOTE] Buttons can be styled (plus the value can be made longer … | |
![]() | Re: [QUOTE=ghost_from_sa;1212009] [CODE] var alphaTest = /^([A-Za-z+]\s)|([A-Za-z+]\s-\s[A-Za-z+]\s)$/; var emailTest = /(^[\w+]|[\w+.w+]@[\w+\.\w+]$)/; var numTest = /(^[00|0|+][\d+]$)/; [/CODE] [/QUOTE] 1. the + signs are misplaced and you are specifying \s which will almost certainly not be present 2. I already posted a better emailRE in another thread 3. misused [brackets] and another misplaced … ![]() |
Re: [QUOTE=k2k;1212869] javascript has any package to do stuff like this. [/QUOTE] [url]http://www.ajaxline.com/10-best-free-javascript-charts-solutions[/url] There are many others (some of which are mentioned in the comments on that page). | |
Re: [QUOTE=phingko;1212669] [CODE]<body onload="sendRequest(Display)">[/CODE] [/QUOTE] [ICODE]<body onload="sendRequest('Display')">[/ICODE] | |
Re: [QUOTE=Erco21;1211866] insert (textbox) [/QUOTE] [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org"> <title></title> </head> <body> <form> <input id="IT"> </form> <script type="text/javascript"> var oITnew = document.createElement("input"); oITnew.setAttribute("value","added"); var oIT = document.getElementById("IT"); var oPAR = oIT.parentNode; oPAR.insertBefore(oITnew,oIT); </script> … | |
Re: [QUOTE=wewehalim;1210540]"credit card number" [/QUOTE] [ICODE]/^\d{16}$/[/ICODE] Many variations are possible. | |
Re: [QUOTE=Reliable;1210360]I want it to go something like this [CODE]<image>http://www.somewhereontheinternet.com/image.jpg</image>[/CODE] Will that work or do image have to be in a folder of the same site where the XML file is?[/QUOTE] The syntax is correct but it is a Bad Thing. See [url]http://altlab.com/hotlinking.html[/url] And if something other than the expected image … | |
Re: [QUOTE=kaylors;1210656]I don't get what's wrong. [CODE] fucntion randy() if(num=>10){num=num%10;} <input type="button" value="Click me!" id="daButton" /> [/CODE] [/QUOTE] 1. Spelling. 2. Syntax. 3. I could suggest [ICODE]<input type="button" id="daButton" value="Click me!" onclick="randy();tB.value=funny(col)">[/ICODE] and other fixes but I stopped reading. ![]() | |
Re: [QUOTE=uberznoob;1208780] age, number of years married and the days of the week that they were born on and married [/QUOTE] You will probably find it easiest to proceed step-by-step create three date objects birth(year,month,day) wedding(year,month,day) today You can now use their getDay() methods and easily do date arithmetic. ![]() | |
Re: [QUOTE=sainiweb;1202938] this missing one last word "me " [/QUOTE] Many other words are also missing. I give you full marks for plugging away at this but - do you realize that [ICODE]wrd_pr_linr = 4[/ICODE] will never look good for sequences of short or very long "words" [ICODE]I a I a … | |
Re: Browser incompatibility: textContent vs. innerText. Also, I think setting innerText obliterates all elements in innerHTML (not an issue here). | |
Re: [QUOTE=Dhanish;1205712] all the validations seem to work [/QUOTE] Er, no. The function 'comparison()' is not defined. | |
Re: [QUOTE=nonshatter;1201452] scripting language [/QUOTE] Google for "javascript countdown". | |
Re: [QUOTE=filch;1205347]I had a working ticket purchase page and I have done something to break it[/QUOTE] I don't know what else may be wrong, but you have a variable and a function with the same name: price. | |
Re: [QUOTE=jazz_vill;1203572] get the values of the Quantity,Price,Total [/QUOTE] [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org"> <script type="text/javascript"> function computeExtensions() { var oTBL = document.getElementById('myTable') for (var iTR = 0; iTR < oTBL.rows.length; iTR++) { … | |
Re: [QUOTE=jino;1205676] I have a date time picker and i have to trigger an event when the text box for that date is filled with the date. [/QUOTE] Check the documentation of the datepicker. If you're lucky, it triggers an event for you; it you're not, you will almost certainly have … | |
Re: [QUOTE=vsmash;1205168]Generally you can't get a client browser to store more than 20 cookies from the same website.[/QUOTE] In RFC-compliant browsers you can make each of the [minimum of] 20 cookies per domain quite large (4096 bytes, including overhead). | |
Re: [QUOTE=xo_vicke93_xo;1204378] member of not, if they select no, nothing happens [/QUOTE] Why not just have a username box which may be left blank? Personally I find popups annoying, and clicking in one box solely for the purpose of causing another one to pop up would be doubly so. Besides, users … |
The End.