JavaScript - Form Information Fetching Problem
Hello everyone,
I've got a problem while trying to fetch some informations from multiple forms in the same page. What I'm trying to do with this code is fetching informations from the multiple forms on my page and checking if the information is the information I need. If so, I take this information and add it into a javascript generated form that I submit once every form in the page have been taken care of. It's the only way I found to 'submit' multiple forms at the same time. Everything was fine until I decided to give the user the option to add more forms on the page by clicking on a button (the form is then generated by javascript and appended on the page). There seems to be a problem when checking these particular forms, the script doesn't seem to recognize the value of the radio button (wich is add_question_faq) and never ever enters in this case. Code: case "add_question_faq": alert ("pourquoi, ho, pourquoi") if (mesForms[cpt].question.value=="" || mesForms[cpt].answer.value==""){ chaineModif+="StopSendRightNow" } break; Except when the commentarised Code: //for (h=0;h<mesForms[cpt].elements.length;h++){ //alert (mesForms[cpt].elements[h].name) //} ain't commentarised. Any Idea why a simple alert changes the behavior of the function? Here's the said function: Code: function select_forms_faq(){ var chaineModif="" var mesFormsModif=new Array(); var mesForms=document.getElementsByTagName("form"); for (cpt=0;cpt<mesForms.length;cpt++){ //for (h=0;h<mesForms[cpt].elements.length;h++){ //alert (mesForms[cpt].elements[h].name) //} if (mesForms[cpt].action.length!=0 && mesForms[cpt].action.length!=undefined){ for (k=0;k<mesForms[cpt].action.length;k++){ if (mesForms[cpt].action[k].checked==true){ switch (mesForms[cpt].action[k].value){ case "delete": chaineModif+="<input type=\'text\' name=\'delete_"+mesForms[cpt].id_question.value+"\' value=\'"+mesForms[cpt].id_question.value+"\' />"; break; case "save_changes_question": chaineModif+="<input type=\'text\' name=\'update_question_faq_"+mesForms[cpt].id_question.value+"\' value=\'id"+mesForms[cpt].id_question.value+"question"+mesForms[cpt].question.value+"answer"+mesForms[cpt].answer.value+"\' />" break; case "save_changes_cat": chaineModif+="<input type=\'text\' name=\'update_cat_faq_\' value=\'id"+mesForms[cpt].id_cat.value+"category"+mesForms[cpt].cat.value+"\' />" break; case "add_question_faq": alert ("pourquoi, ho, pourquoi") if (mesForms[cpt].question.value=="" || mesForms[cpt].answer.value==""){ chaineModif+="StopSendRightNow" } break; } } } } } if (chaineModif!="" && chaineModif.indexOf("StopSendRightNow")==-1){ var formFinal=document.createElement("form") with(formFinal){ method="POST" action="" name="formFinal" id="formFinal" style.display="none" } chaineModif+="<input type=\'hidden\' name=\'submit_changes_faq\' value=\'submit_changes_faq\' />" document.getElementById("wpbody-content").appendChild(formFinal) document.getElementById("formFinal").innerHTML=chaineModif formFinal.submit(); return false } else{ return false } } Similar TutorialsAttached is the code. It does open the email but does not send any information. Can someone please assist. Code: <!-- Table 2 for the Content --> <form name="orders" onsubmit="return confirmSubmit()" onreset="return window.confirm('Are you sure you want to reset your Orders.'); " action="mailto:lynette@sayorkies.co.za" method="post" enctype="text/plain"> Code: // Function to Confirm certain conditions and confirm to proceed with order function confirmSubmit() { var itemsOrdered = true; if (document.forms[2].totalExcl.value == 0 || document.forms[2].delivery.value == 0) { itemsOrdered = false; } if(itemsOrdered != true) { window.alert("You have not chosen any products to purchase or No Delivery Option selected."); return false; } var submitOrder = window.confirm("Are you sure you want to place the order?"); if(submitOrder == true) return true; return false; } // Function to calculate order value function calculateValue(orders) { var orderValue = 0; // Run through all the product fields for(var i = 0; i < orders.elements.length; ++i) { // Get the current field var formField = orders.elements[i]; // Get the fields name var formName = formField.name; // Is it a "product" field? if (formName.substring(0,4) == "prod") { // Items price extracted from name var itemPrice = parseFloat(formName.substring(formName.lastIndexOf("_") + 1)); // Get the Quantity var itemQuantity = parseInt(formField.value); // Update the OrderValue if(itemQuantity >= 0) { orderValue += itemQuantity * itemPrice; } } } // Display the totals orders.totalExcl.value = "R " + orderValue.toLocaleString(); // function to calculate VAT at 15% as required and total inclusive. function calcTotals(oValue) { var vat = oValue * .15; var totalIncluding = oValue + vat; var tDelivery = Number( orders.delivery.value.substring(2) ); var theTotalOrder = totalIncluding + tDelivery; orders.vat.value = "R " + vat.toLocaleString(); orders.totalIncl.value = "R " + totalIncluding.toLocaleString(); orders.totalOrder.value = "R " + theTotalOrder.toLocaleString(); } return calcTotals(orderValue); } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN"> <html> <head> <title>Student Information</title> <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> Code: <SCRIPT type="text/javascript"> <!-- function displayEntries () { var sfirst = document.frmStudentInfo.textSfirst.value; var smi = document.frmStudentInfo.textSmi.value; var slast = document.frmStudentInfo.textSlast.value; var sadd = document.frmStudentInfo.textSadd.value; var scity = document.frmStudentInfo.textScity.value; var sstate = document.frmStudenInfo.textSstate.value; var szip = document.frmStudentInfo.textSzip.value; var sphone = document.frmStudentInfo.textSphone.value; var sdob = document.frmStudentInfo.textSdob.value; window.alert('sfirst' + 'smi' + 'slast' + '\n' + 'sadd' + '\n' + 'scity' + 'sstate' + 'szip' + '\n' + 'sphone' + '\n' + 'sdob'); } //--> </SCRIPT> </head> <body> <table width="70%" align=center ID="Table1"> <tr><td><img SRC = "nwlogo.jpg" width=120 height=60></td> <td><H3>Student Information</H3></td></tr> </table> <form name="frmStudentInfo" action="ignore"> <table align="center"> <tr><td> Last Name:</td> <td><input type="text" name="txtSlast" size="20"></td> <td> </td> <td></td> </tr> <tr><td> First Name:</td> <td><input type="text" name="txtSfirst" size="20" ></td> <td> </td> <td></td> <tr><td> MI:</td> <td><input type="text" name="txtSmi" size="5" tabindex="3"><td> <td> </td> </tr> <tr><td> Address:</td> <td><input type="text" name="txtSadd" size="20" tabindex="4"></td> <td> </td> <td></td> </tr> <tr><td> City:</td> <td><input type="text" name="SCity" size="20" tabindex="5"></td> <td> </td> <td></td> </tr> <tr><td> State:</td> <td><input type="text" name="txtSstate" size="5" tabindex="6"></td> <td> </td> Code: <td><input type="button" name="cmdUpdate" value="Update" onClick="displayEntries();"></td> </tr> <tr><td> ZIP Code:</td> <td><input type="text" name="txtSzip" size="20" tabindex="7"></td> <td> </td> <td></td> </tr> <tr><td> Phone:</td> <td><input type="text" name="txtSPhone" size="20" tabindex="8"></td> <td> </td> <td></td> </td> </tr> <tr><td> Date of Birth:</td> <td><input type="text" name="txtSdob" size="20" tabindex="9"></td> <td> </td> <td></td> </tr> </table> </form> </body> </html> I'm having trouble with the pop up window. I cannot get it to pop up and I'm not sure where I have went wrong with it. I need it to pop up once the update button is clicked and contain the information that has been input into the form. Any help would be much appreciated. Please assist, I have the following code to remember form inormation but it does not seem to work. Probably something stupid. 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> <title>Contact Page</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="yorkie.css" type="text/css" /> <script type="text/javascript"> /* <![CDATA[ */ // Confirm resetting of forms. function confirmReset() { var resetForm = confirm("Are you sure you want to reset the form?"); if (resetForm == true) return true; return false; } // If box clicked value within disappears function Focus(element) { if (element.value == element.defaultValue) { element.value = ''; } } // If nothing typed and box onblur the default value is restored within function Blank(element) { if (element.value == '') { element.value = element.defaultValue; } } // Submission of Contact Form Verified function verifySubmission() { var retValue = true; if (document.forms[2].email.value == "Enter Email Address" || document.forms[2].firstname.value == "Enter First Name" || document.forms[2].lastname.value == "Enter Last Name" || document.forms[2].telephone.value == "Enter Contact number") { window.alert("You did not fill in one of the following required fields: First Name, Last Name, Email Address, or Telephone Number."); retValue = false; } return retValue; } // Email address verified as a valid email address function validateEmail(formObject) { var email = formObject.value; var emailCheck = /^[_\w\-]+(\.[_\w\-]+)*@[\w\-]+(\.[\w\-]+)*(\.[\D]{2,3})$/; if (emailCheck.test(email) == false) { window.alert("The e-mail address you entered does not appear to be valid."); formObject.value = formObject.defaultValue; return false; } formObject.value = email.toLowerCase(); return true; } // Telephone number verified as a valid 10 digit number with no alpha characters function verifyPhone(number) { var phone = number.value; var phoneCheck = /^(\d{10})$/; if(phoneCheck.test(phone) == false) { window.alert("The telephone number you entered does not appear to be valid."); number.value = number.defaultValue; return false; } return true; } // Show additional contact form details onclick of yes radio button function showDiv() { document.getElementById('breeders').style.visibility = 'visible'; } // Hide certain contact form info onclick of No radio button function hideDiv() { document.getElementById('breeders').style.visibility = 'hidden'; } // SAVE FORM INFORMATION FOR THE NEXT VISIT function saveSelections(frm) { var setvalue; var fieldType; var index; var formname = frm.name; // CookieExpiry in 30 days. var today = new Date(); var exp = new Date(today.getTime()+30*24*60*60*1000); var string = "formname=" + formname + "|"; var cookieName = formname; var n = frm.length; for (i = 0; i < n; i++) { e = frm[i].name; fieldValue = frm[i].value; fieldType = frm[i].type; // Radio Buttons if (fieldType == "radio") { for (x=0; x < frm.elements[e].length; x++) { if (frm.elements[e][x].checked) { index = x } } string = string + index + "\|"; } // Text, Textarea, and dropdowns if ((fieldType == "text") || (fieldType == "textarea") || (fieldType == "select")) { string = string + frm.elements[e].value + "\|"; } // Checkboxes if (fieldType == "checkbox") { if (frm.elements[e].checked==true) { var setvalue = "1"; } if (frm.elements[e].checked==false) { var setvalue = "0"; } string = string + setvalue + "\|"; } // Hidden field if (fieldType == "hidden") { string = string + frm.elements[e].value + "\|"; } } setCookie(cookieName, string, exp); } // Load Form Fields from saved cookie function loadSelections(frm) { var e; var z; var x; var cookieName; var fieldArray; var fieldValues; var fieldValue; var formname = frm.id; // Retrieve form elements from cookie and split into array. cookieName = formname; fieldValues = getCookie(cookieName); fieldArray = fieldValues.split("\|"); var n = frm.length; for (i = 0; i < n; i++) { e = frm[i].name; z = i; z++; var fieldType = frm[i].type; var fieldValue = fieldArray[z]; // Radio Buttons if (fieldType == "radio") { x = fieldValue; frm.elements[e][x].checked = true; } // Text, Textarea, and dropdowns if ((fieldType == "text") || (fieldType == "textarea") || (fieldType == "select")) { frm.elements[e].value = fieldValue; } // Checkboxes if (fieldType == "checkbox") { var fld_checkbox = fieldValue; if (fld_checkbox == "1") { frm.elements[e].checked = true; } } // Hidden fields if (fieldType == "hidden") { frm.elements[e].value = fieldValue; } } } // COOKIE FUNCTIONS function setCookie(name, value, expires) { document.cookie= name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : ""); } function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); } /* ]]> */ </script> </head> <body class="contact" onload="var begin=setInterval('changeBanner()',9000); currentClock(); currentDate(); document.getElementById('breeders').style.visibility = 'hidden'; " onunload="saveSelections(document.forms[0])"> <table width="92%"> <form action="mailto:lynette@sayorkies.co.za, subject=Contact Form" method="post" enctype="text/plain" onsubmit="return verifySubmission()" onreset="return confirmReset();"> <table class="center" cellpadding="5" border="1"> <!-- This enters a horizontal line --> <tr><td><hr /></td></tr> <!-- This is for the personal information --> <tr><td><strong>Tell us who you a </strong></td></tr> <tr><td><input type="text" name="firstname" size="25" maxlength="35" value="Enter First Name" onfocus="Focus(this);" onblur="Blank(this);" /> * <input type="text" name="lastname" style="margin-left: 52px;" size="25" maxlength="35" value="Enter Last Name" onfocus="Focus(this);" onblur="Blank(this);" /> *</td></tr> <!-- This is for the contact information --> <tr><td><strong>Your Contact details:</strong></td></tr> <tr><td><input type="text" name="email" size="30" maxlength="60" value="Enter Email Address" onfocus="Focus(this);" onblur="Blank(this); validateEmail(this)" /> * <input type="text" name="telephone" style="margin-left: 20px;" size="20" maxlength="10" value="Enter Contact number" onfocus="Focus(this);" onblur="Blank(this); verifyPhone(this)" /> * </td></tr> <!-- This is where you enter your message also select what type of message--> <tr><td><strong>Your Message:</strong></td></tr> <tr><td align="left">What is your message about?<br /> <input type="radio" name="type" value="compliment" /> Compliment <input type="radio" name="type" value="complaint" /> Complaint <input type="radio" name="type" value="general" checked="checked" /> General <input type="radio" name="type" value="enquiry" /> Enquiry <input type="radio" name="type" value="feedback" /> Feedback</td></tr> <tr><td align="center"><textarea name="message" rows="6" cols="45" onfocus="Focus(this);" onblur="Blank(this)">Enter your message here...</textarea></td></tr> <!-- Additional information --> <tr><td align="left">Are you looking to purchase a Yorkie puppy?<br /> <input type="radio" name="purchase" value="yes" /> Yes <input type="radio" name="purchase" value="no" checked="checked" /> No</td></tr> <tr><td align="left">Do you own a Yorkie?<br /> <input type="radio" name="owner" value="yes" onclick="showDiv()" /> Yes <input type="radio" name="owner" value="no" checked="checked" onclick="hideDiv()" /> No<br /> <!-- If answer is no above the below questions are hidden, if yes then they appear --> <div id="breeders"> How many? <select name="qnty" size="1"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5+</option></select> Are you a breeder? <input type="radio" name="breeder" value="yes" /> Yes <input type="radio" name="breeder" value="no" checked="checked" /> No</div></td></tr> <!-- Subscriptions --> <tr><td align="left">Do you wish to subscribe to the following?<br /> <input type="checkbox" name="subscribe" value="letter" checked="checked" /> Monthly Newsletter<br /> <input type="checkbox" name="subscribe" value="pups" /> Notification of a new litter<br /> <input type="checkbox" name="subscribe" value="updates" /> Notification of site updates<br /> <input type="checkbox" name="subscribe" value="register" /> Registrations</td></tr> <!-- Add a picture file --> <tr><td align="left">Upload your favourite Yorkie photo for the Picture of the Month.<br /> <input type="file" name="upload" accept="image/gif, image/jpeg" size="30" style="margin-left: 15px; margin-top:5px;" /></td></tr> <!-- This enters a horizontal line --> <tr><td><hr /></td></tr> <tr><td align="center">Required fields marked with *</td></tr> <!-- Buttons to clear the form or to submit the form --> <tr><td align="center"><input type="reset" value="Clear the Form" /> <input type="submit" value="Send your message" /></td></tr> </table></form<script type="text/javascript">loadSelections(document.forms[0]);</script> </body> </html> Console Error: Unable to get value of the property 'split': object is null or undefined for this line: Code: fieldArray = fieldValues.split("\|"); I am hitting a brick wall, dont know what to do? I am creating a website for someone and can get information from one form to check it so it can then change the data in another form. This what I have for JavaScript: <script type="text/javascript" language="JavaScript"> function price() { if(document.cust.top.value == None && document.cust.swirl.value == None) { document.price.hosted_button_id.value = "UDNNKUHTPGEEW"; } else { document.price.hosted_button_id.value = "CP8EVFLEASF28"; } } </script> The result I want is to take the value from my form that has a radio buttons and check to see if it equal none or not. Then using that information change the value in a different form. The first form looks like this for beginning: <form name="cust" method="get" action=""> Hey guys, I need some help with fetching a string to be the button text from the html, instead of building it in the javascript, so I can localize it for translations. Right now I have this generating the button: Code: <input type="button" id="share_validate_button" name="share_validate_button" value="<?php echo __('Test Share'); ?> " /> The function __() I am using for the localization stuff, in case you were wondering what that was for. Anyways, below is the JS associated with this button Code: function share_validate_click_add () { $('#share_validate_button').removeAttr('disabled').attr('value', 'Test Share').one('click', function(){ xajax_settings_osb_data_windows_verify(xajax.getFormValues('data_info_form')); $('#share_validate_status').html(''); $(this).attr('disabled', 'disabled').attr('value', 'Testing Share...'); }); } This will display the correct value for the button, and on click, the button disables and text changes to 'Testing Share...' The only problem is the JS overrides the value I set in the html, so I can't localize it. I was wondering if there was a way for me to set the two values (Test Share & Testing Share...) in the html above where we set id and class, and just fetch them in the js where needed. Is this possible? If someone can help me I would really appreciate it! Thanks! Hello all. I am working on a userscript for a site that grabs some weather information for each NFL game. I am trying to loop GM_xmlhttpRequest(s), which has worked okay, but doesn't seem to mix well with arrays. By that I mean I am attempting to push values onto an array, but it doesn't seem to work. So basically at the bottom of the code below, I get values for wind, but not for each windArray[i]. My hunch is that has something to do with the asynchronous behavior of GM_xmlhttpRequest, but I am wondering if there is anyway around that (coding wise). I greatly appreciate any input you can provide. Code: //Strips all html elements from a string String.prototype.stripTags = function() { return this.replace(/<\/?[^>]+>|&[^;]+;|^\s+|\s+$/gi,''); } var weatherURL = new Array(); weatherURL[0] = 'http://www.nflweather.com/game/2011/week-1/bills-at-chiefs'; weatherURL[1] = 'http://www.nflweather.com/game/2011/week-1/bengals-at-browns'; weatherURL[2] = 'http://www.nflweather.com/game/2011/week-1/steelers-at-ravens'; var windArray = new Array(); function getDOC(url, callback) { GM_xmlhttpRequest({ method: 'GET', url: url, onload: function (responseDetails) { var dt = document.implementation.createDocumentType("html", "-//W3C//DTD HTML 4.01 Transitional//EN", "http://www.w3.org/TR/html4/loose.dtd"), doc = document.implementation.createDocument('', '', dt), html = doc.createElement('html'); html.innerHTML = responseDetails.responseText; doc.appendChild(html); callback(doc); } }); } for (var i=0; i<weatherURL.length; i++) { getDOC(weatherURL[i], function(doc) { var pageTds = doc.getElementsByClassName('no-line'); var wind = pageTds[9].innerHTML.stripTags(); //alert(wind); windArray.push(wind); //alert(windArray[i]); }); } Hey all. I'm looking for a way to have a single, random line fetched from multiple text files, and then have that combination output somewhere, whether just to some field or another text file. For example: Text file A - I like I hate I love I despise I cherish Text file B - apples bananas oranges grapes grapefruit pineapple cherries Text file C - some of the time. most of the time. a lot of the time. pretty much never. So it would go in, get a line from each, and display something like: I love - grapefruit - most of the time. I cherish - pineapple - some of the time. etc. etc. I know it's a weird-sounding example, but you get the point. The line choices don't have to be separated by hyphens, but they preferably would be separated by something, like a comma, semi-colon, slash, whatever. I know this is pretty much a web coding forum, so that would be fine if I had to host it on my server or open it with a browser. But it would be optimal if this could be made into a standalone executable. I'm basically looking for something like Random Line Picker, just with the added functionality I mentioned. I'd be willing to make a little donation to someone if coding this would be a little difficult. Thanks! function Button1_onclick() { var v = 'parser2.php?data='+document.getElementById('message').value; ShowWebSite(v); } This is my code. I want to retain the \n in end of each line so that PHP can handle the input more well. But document.getElementById removes the \n. Is their any way to prevent this? hi guys. im new to javascript and i require some help on a task so hoping someone on here could help me and possibly push me in the right direction. so i have a website with content on specific pages i need some sort of JS soloution which will fetch an ID/Keyword out of the page content so when a button is clicked it finds the ID/keyword and directs the user to a specific form/page. is this possible and can any1 help? Cheers, Ant. I'm facing an issue with fetching the page URL from an IFRAME with cross domain. Is there any approach/ any ways to achieve this? Hi everyone I need to make a chrome extension that will be work like panel like on site "http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/" but in my case this panel should work on every site and be always on top of every page content. I implemented this with iform element and added div element same size as iform to the end of the body, so my panel will not hide the end of page . The problem is adding this panel to sites like gmail. in this case I cant add element to the end of page and it's hide part of content. How can I solve this problem or is there any other way to make this.
Hi! I installed the Animated Information Bar found on http://www.javascriptkit.com/script/.../infobar.shtml Now there is a option to display the bar once per session but this isn't working... Code: infobar.setfrequency('session') //Uncomment this line to set information bar to only display once per browser session! Anyone has installed this bar and knows why this isn't working? I use IE8 greetings Jardin Holland This is what i want to do but Im not sure if it is possible i just want a push in the right direction to how to do it anyway. How would i go about displaying information on my site collected from another site its for a sports website i don't want to have to count tackles in each footy game i just want to take certain stats from another site and display them on mine is this something that can be done using JavaScript? thanks any help would be great Hello. The link below is the result of a product search on a website. It displays 2 results. However, the actual results (picture & information) that are displayed on the web page are not present in the "Page Source". For example, if you search the page source for the string '860723' (which is one of the product numbers visible on the web page) it is not there. What is going on here? It looks to me like dummy images & information in the HTML are first loaded by the browser, and then that dummy info gets replaced by the real information via a javascript function. Is that what's going on? http://www.lightsamerica.com/metro/s...mber:SL9469-8; I'm trying to retrieve that information by downloading the source in my PHP program. The problem is that the information I want isn't present in the source. It stands to reason that the information is somehow being sent to the browser because I can see it... any ideas? Thanks for your time, -Scott hi everyone, is it possible to get information about image, or generally speaking a file using javascript??? lets say i used a browse button (input type="file") and when the user selects the file, i can get the file information - like if it were an image, then its dimensions and if possible, then the file size too... is this possible in javascript??? thanks in advance Hemal It appears that .html() is somehow messing up reading the contents of a div. Here is my php code which loads into the div. Code: $own_pre_selection .= "<input name='" . mysql_result($result,$i,"did") . "' value='" . mysql_result($result,$i,"did") . "' type='hidden'><span class='addremove' onclick=\"recordchecks('" . mysql_result($result,$i,"dname") . "','" . mysql_result($result,$i,"did") . "')\";><u>Remove</u></span> " . mysql_result($result,$i,"dname") . "<br>"; Here is what I see as source code after the page renders. Code: <input name='677' value='677' type='hidden'><span class='addremove' onclick="recordchecks('Heart Neoplasms','677')";><u>Remove</u></span> Heart Neoplasms<br><input name='1298' value='1298' type='hidden'><span class='addremove' onclick="recordchecks('Heart Septal Defects; Atrial','1298')";><u>Remove</u></span> Heart Septal Defects; Atrial<br></div> When I test alert() the .html() contents it appears like this. It seems to screw up the quote escape and changes \" to " ;="" after the recordchecks(). Code: <input name="677" value="677" type="hidden"><span class="addremove" onclick="recordchecks('Heart Neoplasms','677')" ;=""><u>Remove</u></span> Heart Neoplasms<br><input name="1298" value="1298" type="hidden"><span class="addremove" onclick="recordchecks('Heart Septal Defects; Atrial','1298')" ;=""><u>Remove</u></span> Heart Septal Defects; Atrial<br> So even though the source code looks perfect, if I alert() the div contents with html() it seems to get a bit garbled in the process. Any ideas? hi, I am looking for help creating javascript auto-apearing box, which will appear when someone onmouse on the hyperlink. In the appeared box I want to show some PHP script and other text. See in my example attached Regards. Hi Guys I'm trying to find a way to insert a dropdown eg: <select> <option>Volvo</option> <option>Saab</option> <option>Mercedes</option> <option>Audi</option> </select> ...place the dropdown to the left and have an information panel to the right. i.e. if a user chooses Volvo a panel to the right would appear saying eg "Volvo is a strong car" and so on for other selections eg "Audi is a fast car" if the user selects Audi in the dropdown. THANKS How would you access information about various attributes of an element with javascript?
|