JavaScript - Weird Problem: None Of The Input Boxes Usable In Ie6
Hello there,
Problem: I was able to see problem only in IE6 Form input fields not clickable and not accepting inputs + Can't even select text or perform most right-click functions. URL: http://www.webhostingkit.com/a/cgi/p...usercontactall Was wondering if anyone can help me out with this weird problem. Not sure why, but none of the input form fields are able to accept values or even clickon them. Site displays just fine in IE, however anywhere on the site, when user tries to input, it just won't show happen, any idea on what is wrong or how to fix this? Thanks again. ** Edit ** If anyone has IE6 installed can you please test it, cuz I am thinking it might be just the standalone version of IE I have might be having the issue, as in that IE, some major sites (including yahoo.com) are having the same issues. Similar TutorialsI am working on a job calculator. I have 2 txt input boxes titled "project_rate_field" and "project_time_field" as well as a third box .. "project_pay_total_field" for output.. I need to multiply the rate field and the time field and output the total into the third box. I've never really used javascript before so I dont know much about it or how to write it but im trying to learn. Here is my .js file ... Code: function project_pay_details() { var rate = document.getElementById("project_rate_field").value; var time = document.getElementById("project_time_field").value; var total = (rate * time); project_pay_total_field.value = "$" + total; } And here is my .html file Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <script language="javascript" type="text/javascript" href="functions.js" /> <style> .wrap { float: right; } #project_pay { float: left; margin-right: 15px; line-height: 38px; font: 10px Arial, Helvetica, sans-serif; color: #bbb; } #project_pay_details { border-top: 1px dotted #ddd; padding-bottom: 10px; margin-top: 10px; float: right; width: 100%; } .field { border: none; line-height: 38px; font: 20px Arial, Helvetica, sans-serif; color: #666; width: 100px; font-weight: bold; margin-top: 6px; } </style> </head> <body> <form id="project_pay_details" name="form1" method="post" action="" class="editable"> <div class="wrap"> <div id="project_pay">Pay Rate<input type="text" name="project_rate_field" id="project_rate_field" class="field" value="10" />/ hr</div> <div id="project_pay">Total Hours<input type="text" name="project_time_field" id="project_time_field" class="field" value="0" /></div> <div id="project_pay">Project Total<input type="text" name="project_pay_total_field" id="project_pay_total_field" class="field" readonly="readonly" value="0" /></div> <input name="project_pay_details_refresh" type="button" value="Refresh" onClick="project_pay_details()" /></input> </div> </form> </body> </html> I need to know what im doing wrong because this obviously doesnt work. I am stuck on this question. 1. To set the value contained in a field such as an input box, you must use the ____________________ property. This is based on Javascript. What type of properties are used for fields in an input box? Thanks In a form I have two input boxes (ids of return1 and return2) with default values of 0 and a span element (id return3). The span's value is initalized to 0 on page load, and it updates when a button is clicked that calculates x - value of return1 - value of return 2, where x is calculated elsewhere. Form code: Code: Month 1: <input size="7" type="text" value="0" id="return1" name="return_1"> <input type="button" value="Calculate Remaining Amount" onClick="thirdReturn();"> Month 2: <input size="7" type="text" id="return2" value="0" name="return_2"> Month 3: <span style="color:black; font-size:14px;" id="return3"></span> ThirdReturn code: Code: function thirdReturn() { var first_return = document.getElementById("return1").value; var second_return = document.getElementById("return2").value; first_return = first_return.replace(/\,/g,''); second_return = second_return.replace(/\,/g,''); var combined = Number(first_return) + Number(second_return); if (typeof this.remaining_pipp_amount == "undefined") { alert('Please select a Flex option'); } else{ if (combined > this.remaining_pipp_amount){ alert('Return Amount Exceeds Credit Amount'); } else{ var temp = this.remaining_pipp_amount - combined; var third_return_amount = document.getElementById("return3"); third_return_amount.innerHTML = addCommas(Math.round(temp)); } } } I am trying to change it so that if return2 is zero when the button is clicked, return2 = x - return 1. Here is what I have: Code: function thirdReturn() { var first_return = document.getElementById("return1").value; var second_return = document.getElementById("return2").value; first_return = first_return.replace(/\,/g,''); second_return = second_return.replace(/\,/g,''); var combined = Number(first_return) + Number(second_return); if (typeof this.remaining_pipp_amount == "undefined") { alert('Please select a Flex option'); } else{ if (combined > this.remaining_pipp_amount){ alert('Return Amount Exceeds Credit Amount'); } else{ var temp = this.remaining_pipp_amount - combined; if (second_return == 0){ var new_second = document.getElementById("return2") new_second.innerHTML = Math.round(temp); } else{ var third_return_amount = document.getElementById("return3"); //alert (temp); third_return_amount.innerHTML = addCommas(Math.round(temp)); } } } } Does anyone know why this doesn't work or what can be done to fix it? Thank you! This little script works nicely in IE, and FF but fails in Chrome. It saves the contents of input boxes and displays them next time the page loads: (the cookie functions are the usual ones) Code: window.onload = function() { var theInputs = document.getElementsByTagName('input'); for(var i = 0; i < theInputs.length; i++) { if(theInputs[i].type == 'text') { theInputs[i].onkeyup = function() { createCookie(this.name,this.value,9999); } } if(readCookie(theInputs[i].name+'val') != null) { theInputs[i].value = readCookie(theInputs[i].name+'val'); } } } Is there an obvious reason why Chrome is not doing this? I can't figure this. Basically I have a dialogue pop out box. When you type a value in the pop out box,and press enter, it will change the value in the input boxes. Let say I have five input boxes, four of the input box has 7 as value,the last input box has 15 value. When I type 8 and enter, it should change only the value of 15(from 15 to 8) as 15 is greater than 8. If I type 4, it should change all the values of input boxes as all of the input box values are greater than 4. I have set the condition to 18 as input boxes are 18 columns. jsNewDisc is the user input value. Below are some pieces of codes. Of course if I type 5 and enter, this condition will change all the values in the five input boxes as they are all of greater value. If I input 8, input box that has a value of 15 will be the only one that will be change as it has greater value. Code: for (a=1;a < 18; a++){ if(document.getElementById('R4'+ a).value>jsNewDisc){ document.getElementById('R4'+ a).value = jsNewDisc; } } Hello all, I have a requirement where i need to take an IPv4 address as an input, my web page has 4 text boxes. If i have a address like this 255.255.255.255, my program jumps into the next text box without any problem as soon as i enter the 3 digits. i dont need to press any tab or any other key to go to next text box. In case of an address like 12.24.12.3, i have to press <tab> to jump into the next text box, My project requirement says that it should work with '.' (dot) char as well. SO here is my actual requirement i need to jump into the next text box as soon as user enters a dot (.) char without displaying the dot into the text box. I am writing this program in perl CGI. Thanks, Vaibhav I've been playing around with a madlibs exercise while trying to learn simple javascript. I have three input boxes and a button display an alert containing the input from the boxes. Am I right to be assigning variable names to the values from the text boxes and then referencing those variables in my alert? I'm sorry if this is a dumb question but I've been working on it for hours and can't get past this point. Inset a name: <input type="text" id="textbox1" size="10"/> </br> Insert a verb : <input type="text" id="textbox2" size="10"/> </br> Insert a place: <input type="text id="textbox3" size="10"/> <input type="button" value="CLICK WHEN FINISHED" onClick="name = document.getElementById('textbox1').value; verb = document.getElementById('textbox2').value; place = document.getElementById('textbox3').value; alert('Mad Lib :' + name + " " + verb + " " + place);" /> Hi Everyone, Here is the question: How do I make my website viewable and usable by everyone on my network (in other words, locally)? See below for details. I'm working on a web-application (primarily Javascript and html) that will be located in a folder that everyone has access to at my company. This page is a fairly basic (a person signs-in, their name appears in a table below....the table is constantly growing). My goal is to make everyone able to dynamically add to this table. They need to be able to refresh the table and see it in its current state, and add their names to and continue growing the table. Of course, if I just place my basic web application in the folder everyone has access to, they open it to its original state. I appreciate any response. I'm VERY new to JavaScript and html, though I'm pretty well versed in a few other programming languages (VBA and MATLAB particularly), so I apologize if this is a very basic question. I'll copy in my working code so far, if that helps give a better visualization of what I mean. Code: <html> <STYLE TYPE="text/css"> body{margin: 0; padding: 0} tr.headerT { font-family: Calibri; font-size: 16pt; color: white; text-align: center } input.entryname{width: 150px;} select.optionitem{width: 150px;} .odd{background-color: white; height: 25px;} .even{background-color: E1E1E1; height: 25px;} .sidebar{background-color: AFD7E7;} </STYLE> <script language="JavaScript"> function getDate() { var TimeArray = new Date(); var o_Month = TimeArray.getMonth() + 1; var o_Day = TimeArray.getDate(); var o_Year = TimeArray.getFullYear(); o_Date = o_Month + "/" + o_Day + "/" + o_Year return o_Date } function getTime() { var TimeArray = new Date(); var o_Hours = TimeArray.getHours(); var o_Minutes = TimeArray.getMinutes(); var o_Seconds = TimeArray.getSeconds(); if (o_Hours < 10) {o_Hours = "0" + o_Hours} if (o_Minutes < 10) {o_Minutes = "0" + o_Minutes} if (o_Seconds < 10) {o_Seconds = "0" + o_Seconds} o_Time = o_Hours + ":" + o_Minutes + ":" + o_Seconds return o_Time } function Test2(tableID, selectID, inputID, selectID2) { var table = document.getElementById(tableID); var rowCount = table.rows.length; var row =table.insertRow(rowCount-1); var RowStyle = table.getElementsByTagName("tr"); var Cell1 = row.insertCell(0); var Cell2 = row.insertCell(1); var Cell3 = row.insertCell(2); var Cell4 = row.insertCell(3); var Cell5 = row.insertCell(4); var Cell6 = row.insertCell(5); var Cell7 = row.insertCell(6); var Cell8 = row.insertCell(7); var Cell9 = row.insertCell(8); var entered_name = document.getElementById(inputID).value; var selected_index = document.getElementById(selectID).selectedIndex; var selected_value = document.getElementById(selectID).options[selected_index].value; var index2 = document.getElementById(selectID2); index2.options[index2.options.length] = new Option(entered_name); index2.options[(index2.options.length)-1].value = entered_name; Cell1.className = "sidebar"; Cell2.innerHTML = getDate(); Cell2.align = "center"; Cell3.innerHTML = getTime(); Cell3.align = "center"; Cell4.innerHTML = selected_value; Cell4.align = "center"; Cell5.innerHTML = entered_name; Cell5.align = "center"; Cell9.className = "sidebar"; if((rowCount-1)%2==0){ RowStyle[rowCount-1].className = "even"; }else{ RowStyle[rowCount-1].className = "odd"; } } function Test3(tableID, selectID_rep, selectID_mem) { var dat_table = document.getElementById(tableID); var rowCount = dat_table.rows.length; var mem_select = document.getElementById(selectID_mem); var mem_index = mem_select.selectedIndex; var mem_value = mem_select.options[mem_index].value; var rep_select = document.getElementById(selectID_rep); var rep_index = rep_select.selectedIndex; var rep_value = rep_select.options[rep_index].value; for (i = 0; i<(rowCount-1); i++) { if(dat_table.rows[i].cells[4].innerHTML==mem_value) { if(dat_table.rows[i].cells[5].innerHTML=="") { dat_table.rows[i].cells[5].innerHTML = rep_value; dat_table.rows[i].cells[5].align = "center"; dat_table.rows[i].cells[6].innerHTML = getTime(); dat_table.rows[i].cells[6].align = "center"; } else if(dat_table.rows[i].cells[5].innerHTML==rep_value) { dat_table.rows[i].cells[7].innerHTML = getTime(); dat_table.rows[i].cells[7].align = "center"; mem_select.removeChild(mem_select.options[mem_index]); } } } } </script> <head> <form> <table width = 100% height = 120 border = "0" cellspacing = "0" cellpadding = "0" bgcolor = "white" id="shell" align ="center"> <tr align ="right"> <td rowspan="5" align="left" valign="top"> <IMG SRC="Logo.jpg"> </td> <td rowspan="2" colspan="2"> <IMG SRC="Title_SignIn.jpg"> </td> <td colspan="2" > <IMG SRC="Title_Staff.jpg"> </td> <td width = "10%">   </td> </tr> <tr align ="right" valign = "top" style = "height: 30px"> <td width = "30%"> Select Member:  </td> <td width = "10%"> <select name = "select_member" style = "width: 200px"> </select> </td> <td> </td> </tr> <tr align ="right" valign = "top" style = "height: 30px"> <td width = "10%"> Name:   </td> <td width = "10%"> <input type="text" name="full_name" class="entryname"> </td> <td> Representative:   </td> <td> <select name = "select_rep" style = "width: 200px"> <option value="Rep A">RV Watson</option> <option value="Rep B">Daisy Bauer</option> <option value="Rep C">Mike Andrews</option> </select> </td> </tr> <tr align ="right" valign = "top" style "hieght: 30px"> <td> Reason:   </td> <td> <select name = "reason" class = "optionitem"> <option value="Eligibility">Eligibility</option> <option value="Sick Leave">Sick Leave</option> <option value="Claims">Claims</option> <option value="Pension">Pension</option> </select></td> <td> Password:   </td> <td> Password Box </td> </tr> <tr align ="right" style = "height: 30px"> <td>   </td> <td> <input type="button" value="Sign In" name="btnSignIn" onClick="Test2('thetable', 'reason', 'full_name', 'select_member')"> </td> <td>   </td> <td> <input type="button" value="Sign Member In / Out" name="btnStaff" onClick="Test3('thetable', 'select_rep', 'select_member')"> </td> </tr> </form> </head> <table id ="thetable" width = "100%" height = "100%" border="0" valign="center" cellspacing="0" cellpadding="0" bgcolor="white" id="shell" align="center"> <tr class = "headerT" bgcolor="gray" height = "40"> <td style = "width = 50px"> </td> <td style = "width = 100px">DATE</td> <td style = "width = 150px">TIME</td> <td style = "width = 100px">REASON</td> <td style = "width = 200px">NAME</td> <td style = "width = 200px">REPRESENTATIVE</td> <td style = "width = 150px">START TIME</td> <td style = "width = 150px">END TIME</td> <td> </td> </tr> <tr> <td colspan="1" bgcolor = "AFD7E7"> </td> <td colspan="7" ></td> <td colspan="1" bgcolor = "AFD7E7"> </td> </tr> </table> </body> </html> so my code is Code: function more(){ alert("You can't eat more apples then you have"); } function apple(){ var apples = prompt('How many apples do you have'); var eat = prompt('How many did you eat'); if(eat > apples){ more(); } if(eat <= apples){ var eaten = apples - eat; alert('You ate '+ eaten + ' apples!'); } } My problem is unless you enter 1 for how much did you eat, it goes to the more function. Hello guys, I'm currently writing an web application using java servlets and javascript. Today i ran into this weird problem. The servlet sends to the client an html page which has an javascript in it and a form. Upon completion of the form and pressing the submit button the javascript does not execute(but the form is sent, function is called with the onclick tag). If i view-source this page from my browser and save it to an .html file locally the javascript function executes just fine. Any help greatly appreciated Some people claim that the window.onload does not fire in some browsers, under some OS, when the page is re-loaded using the back button of the browser. The simple code is: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <script type="text/javascript"> onload=function(){ alert('foo') } </script> </head> <body> <a href="http://www.google.com">go Google then press the back button</a> </body> </html> Open the document, click the link, then press the Back button of the browser. Surprisingly, in FF 3.6.3 (at least) the window.onload event is not read again, thus it does not fire the function. That is a severe issue, as a lot of JavaScript codes are based on onload event. Is it a bug? Does that happen only locally (I can not test it on a server this moment)? Are there any other browsers or other browsers' versions which act in the same way? Any thoughts? For some reason i cant get this bit of code to work. You can ignore the php and html if its getting in your way. Thanks: Code: <div id="pl"> <? if($edit == true){ ?> <script type="text/javascript"> $("#add_playlist_form").css({display:"none"}); $("#add_playlist").click(function(){ alert($("#add_playlist").html()); if($("#add_playlist").html() == "Add a Playlist >>"){ $("#add_playlist").html("Hide <<"); $("#add_playlist_form").css({display:"block"}); } else{ $("#add_playlist").html("Add a Playlist >>"); $("#add_playlist_form").css({display:"none"}); } }); </script> <a href="#" id="add_playlist">Add a Playlist >></a> <form id="add_playlist_form" method="POST" action=" "> <input type="text" name="pl_name" class="add_playlist"/> <textarea name="pl_dsec" maxlength="200"></textarea> <input type="submit" name="submit_playlist" value="Add Playlist" class="submit_playlist"/> </form> <? } ?> <ul class="vList"> Hi guys, I am new to Javascript and I'm trying to set up a form to make simple calculation based on user inputs. I have set up the form and am unable to get the calculation to work despite what I try (this is based on an online tutorial I found though). Is there any where I am going wrong? Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script type="text/javascript" language="javascript"> function kanban() { //variables A = document.frmone.annualdemand.value; B = document.frmone.demandVariability.value; C = document.frmone.weeksHold.value; D = document.frmone.ContainerSize.value; E = document.frmone.totalStock.value; //calculation F = A/240; double G = (b/100)+1; H = g*F; c = c*5; i = c*H; j = i/d; document.frmone.totalStock.value = i; document.frmone.noKanBans.value = j; } </script> <title>Insert Title Here</title> </head> <body> <form name="kanban" id="frmone"> Annual Demand: <input type="text" name="annualDemand" value=""/> </br> Demand Variation: <input type="text" name="demandVariability" value=""/> </br> Stock to Hold (weeks): <input type="text" name="weeksHold" value=""/> </br> Size of Container: <input type="text" name="containerSize" value=""/> </br> </br> <input type="button" name="calculate" value="Calculate" onclick="kanban()"/> </br> </br> Total Stock: <input type="text" name="totalStock" value=""/> </br> Qty of Kan Bans: <input type="text" name="noKanBans" value=""/> </br> </form> </body> </html> Thanks guys. Hi, i try to do that every char that i type in a input-type there will be a alert, but it doesnt do that, when the page loads it pop ups one time an alert and it doesnt pop up more alerts when i type something in the input-type Sorry for the bad english here is my code Code: <script type="text/javascript"> function init() { document.Form1.phone.onkeyup= alert('a'); } window.onload=init; </script> Hi I have a problem with a form in my site he http://www.21centuryanswers.com/submit.php if no field is filled and you click submit, an alert will be shown, yet the next page will still load! How do I fix it? the code for the form is: <form action="privacy.php" method="post" onsubmit="return checkform(this);"> <fieldset> <center> E-mail: <input type="textfield" name="email" size="60" value="" /><br/></br> Question: <input type="textfield" name="question" size="70" value="" /><br/><br/> <input type="submit" value = "Submit"/> </center> </fieldset> </form> and here is the validation script: <script language="JavaScript" type="text/javascript"> <!-- function checkform ( form ) { // ** START ** if (form.email.value == "") { alert( "Please enter your email." ); form.author.focus(); return false ; } if (form.question.value == "") { alert( "Please enter the question." ); form.title.focus(); return false ; } // ** END ** return true ; } //--> </script> Please help! I am thinking this should be fairly easy but yet I am not getting far. I want to have a form with a single text imput field for a zip code. Depending on which zip code the user enters will determine which url they will be sent to. If they enter a zip code which is not in the script, they would be sent to a default url. I am also assuming this can be accomplished with javascript. Any help is greatly appreciated. I have a problem with adding new inputs to a form (if and when required), Internet Explorer is fine but in Firefox if any previous input fields are filled when the more button is clicked they get reset to blank. JS: Code: fields = 0; function addInput() { if (fields != 100) { document.getElementById('input').innerHTML += "<input type='text' name='input[]' size='30' />"; fields += 1; } else { document.getElementById('input').innerHTML += "<br />Maximum 100 fields allowed."; document.form.add.disabled=true;} } form: Code: <form action="index.php" method="post"> <div id="input"> <input type="text" name="input[]" size="30" maxlength="15" /> </div> <!-- button --> <div id="more"> <input type="button" onclick="addInput()" name="add" value="More" /> </div> <!-- // button --> <input type="submit" name="submit" value="Submit" /> </form> as usual any help is appretiated .. Hi, i want to set an input value to the same value as the input selected from another input on the same form so when the user selects input 1 i want the hidden input2 to get the same value im guessing i use onsubmit because its hidden so there wont be a focus or blur this would be part of the input Code: onsubmit="(this.value = this.othervalue)" othervalue being the other input name="othervalue" is that the correct syntax So I have the following code in javascript that creates an iframe: Code: var iframe = document.createElement("iframe"); iframe.id = 'offerframe'; iframe.name = 'offerframe'; iframe.width = '975'; iframe.height = '650'; iframe.align = 'center'; iframe.src = 'http://example.com'; document.getElementById("offer-frame-div").appendChild(iframe); It works fine in Firefox and Safari but in IE8 it generates the iframe name attribute to "submitName" Code: <iframe width="975" height="650" align="center" id="offerframe" submitName="offerframe" src="http://example.com"> Notice how it sets all the other attributes fine, however the name attribute is now called "submitName". This issue only happens in IE. This there any alternatives to setting my iframe name dynamically with javascript. I am new here. I've been trying to learn javascript, php, ajax, and others on my own, through the help of researching. I can't seem to manage figuring this out. I'm using a string "A B C" for sake of example. Variable d goes through a for loop checking for capital letters, to make substrings. d=0 finds A and makes the substring A. d=1 finds B and makes the substring AB. d=2 finds C and makes the substring ABC. It seems to me that: d=0 should be A d=1 should be B d=2 should be C. (which is what I want) Here's the actual code (obviously, the actual string being worked with is not 'A B C'): Code: response = response.replace(/([A-Z])(?![A-Z])/g, " $1") ; response1 = new Array(); caps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; a=0 ; q=0 ; for (a=0 ; a<=response.length-1 ; a++) { for (q=0 ; q<caps.length ; q++) { if (response.charAt(a) == caps.charAt(q)) { response1[response1.length] = response.substring(a,' ') ; }}} response1 = response1.filter(function(){ return true}) ; b=1 ; for (b=1 ; b<=response1.length-1 ; b++) { document.write(response1[b] + "<br />") ; } } |