Jump to content

Search the Community

Showing results for tags 'javascript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

  1. Hey Everyone! i have write this code for sending mail but it is not working. It is echoing the Error message. <?phpinclude "config.php";if(!$_POST) exit;$email = $_POST['email'];if(!preg_match('/\.([^\.]*$)/',$email )){$error.="Invalid email address entered";$errors=1;}if($errors==1) echo $error;else{$values = array ('name','email','message');$required = array('name','email','message'); $your_email = "aneeb@gmail.com";$email_subject = "New Message: ".$_POST['subject'];$email_content = "new message:\n";foreach($values as $key => $value){ if(in_array($value,$required)){ if ($key != 'subject' && $key != 'company') { if( empty($_POST[$value]) ) { echo 'PLEASE FILL IN REQUIRED FIELDS'; exit; } } $email_content .= $value.': '.$_POST[$value]."\n"; }} if(@mail($your_email,$email_subject,$email_content)) { echo 'Message sent!';} else { echo 'ERROR!';}}?> Please help me..
  2. <tr style="background-image: url("background-image.jpg")"></tr> I wonder how we can get the attribute (url).I'm not sure about it. document.getElementsByTagName("tr").getAttribute("style.backgroundImage");
  3. Although I can console.log lastSel it is coming up as a blank when the PHP is called in the header. So when the header is passed it is id: "" even though clearly there is a value in lastSel and I am type casting to string. I am wondering what could be the source of the issue. lastSel is defined outside of any function braces as just "lastSel = """ without using the var keyword. Why would it be blank as String(lastSel) even though I can console.log a value? <script>$(function(){var date = new Date();var d = date.getDate();var m = date.getMonth();var y = date.getFullYear(); $('#calendar1').fullCalendar({ // put your options and callbacks hereheader:{left: 'prev,next today',center: 'title',right: 'month,basicWeek,basicDay'},editable: true,droppable: true,selectable: true,events: {url: 'php.scripts/events.get.php',type: 'POST',data: {id: String(lastSel),custom_param2: 'somethingelse'},error: function() {alert('there was an error while fetching events!');},color: 'yellow', // a non-ajax optiontextColor: 'black' // a non-ajax option},eventClick: function (calEvent, jsEvent, view) { $( "#eventdialog2" ).dialog({resizable: false,height:500,width:500,modal: true,buttons: {"Update": function() {$( this ).dialog( "close" );},Cancel: function() {$( this ).dialog( "close" );}}}); },eventDrop: function (event, dayDelta, minuteDelta, allDay, revertFunc) { },select: function(startDate, endDate, allDay, jsEvent, view) { $( "#eventdialog1" ).dialog({resizable: false,height:500,width: 500,modal: true,buttons: {"Add": function() {if(jQuery("#event_title1").val() == ""){alert("All active text fields are required input!");return false;}$( this ).dialog( "close" );},Cancel: function() {$( this ).dialog( "close" );}}}); } }); $('#calendar2').fullCalendar({ // put your options and callbacks here });});</script> <script>lastSel = "";$(function(){ $("#list").jqGrid({ url:'php.scripts/get.customers.php', datatype: 'xml', mtype: 'POST',colNames:['idcustomers','firstname', 'lastname','address1','address2','city','state','zip','phone','email','cell'], colModel :[ {name:'idcustomers', index:'idcustomers', width:55}, {name:'firstname', index:'firstname', width:90, editable: true}, {name:'lastname', index:'lastname', width:90, editable: true}, {name:'address1', index:'address1', width:90, editable: true}, {name:'address2', index:'address2', width:90, editable: true}, {name:'city', index:'city', width:90, editable: true}, {name:'state', index:'state', width:90, editable: true}, {name:'zip', index:'zip', width:90, editable: true}, {name:'phone', index:'phone', width:90, editable: true}, {name:'email', index:'email', width:90, editable: true}, {name:'cell', index:'cell', width:90, editable: true} ], pager: '#pager', rowNum:20, rowList:[20,100,300], sortname: 'idcustomers', sortorder: 'asc', viewrecords: true, gridview: true, caption: 'Customers',width: 1400,height: 290,editurl: 'php.scripts/update.row.php',ajaxGridOptions: {type:"POST"},onSelectRow: function(id){ if(id && id!==lastSel){ jQuery('#gridid').restoreRow(lastSel); lastSel=id;jQuery("#list").data('selid',lastSel);console.log(lastSel);console.log(jQuery("#list").data('selid'));} //jQuery('#list').editRow(id, true); jQuery('#list').data('selid', jQuery("#list").getCell(lastSel,0));jQuery('#list').data('firstname', jQuery("#list").getCell(lastSel,1));jQuery('#list').data('lastname', jQuery("#list").getCell(lastSel,2));jQuery('#list').data('address1', jQuery("#list").getCell(lastSel,3));jQuery('#list').data('address2', jQuery("#list").getCell(lastSel,4));jQuery('#list').data('city', jQuery("#list").getCell(lastSel,5));jQuery('#list').data('state', jQuery("#list").getCell(lastSel,6));jQuery('#list').data('zip', jQuery("#list").getCell(lastSel,7));jQuery('#list').data('phone', jQuery("#list").getCell(lastSel,8));jQuery('#list').data('email', jQuery("#list").getCell(lastSel,9));jQuery('#list').data('cell', jQuery("#list").getCell(lastSel,10)); } }).jqGrid('navGrid','#pager',{ edit: false, add: true }, {}, {}, {}, {}, {}).jqGrid('inlineNav',"#pager",{}); }); </script>
  4. Hi, I am having problems with a script I am recycling from my client's old site. The issue was there before but wondering if there is a way to fix it. The page is here: http://www.tech-one-biomedical-services--inc.mybigcommerce.com/contact/ The email links don't work now that there is a class assigned to the table, enabling the backgrounds to be highlighted when the parts of the map are clicked on. They didn't work before either but I didn't realize it until the client pointed it out. I see when I hover in Firefox it looks like it should work, see the mailto: ref coming up, but when you click...nothing. Is there any way to either get the same effect with the clicking (or even hovering would be fine) so that the email links inside work? I tried embedding a table in this but it didn't work either. The original scrip is at: http://www.techonebiomedical.com/contact.html I am java illiterate so have no idea on the insides. Thanks!Gina
  5. Hi! I am making a little game for iOS using apache's Cordova.I use Zepto.js as a light css3 jQuery replacement for animations etc. Players have to create letters as Wim Crouwel did in his New Alphabet, they have to do it in a short amount of time, thus far the project is going fine for the limited skills i have but now i am encountering a problem and i dont know where it could come from. What happens is that when i validate if a letter hase been constructed correctly and it is in fact correct it adds 2 "levels" instead of just 1, what i discovered is that the script actually runs twice. It even reacts tot the amounts of clicks i made on the page, lets say i click 4 "clickable" element's on the page it ads 4 levels. This is what i get in the console: 2 clicks = 2 levels up?validating...correct! go from level 0 to..1validating...correct! go from level 0 to..2 here is a live demo:http://bram-de-leeuw...welGame/(you'll probably have to resize your browser to make it work, the first thing you'll see is a iPhone5 version that isn't styled correctly. When you'll make your browser smaller it will show a iPhone 4 version.) This is the validation code: // Validate Letter A$("#verder").click(function () {//if (Level = 0){ // LETTER = A // CORRECT console.log("validating..."); if ( // LETTER A $(".CenterBottom").hasClass("black") === true && $(".CenterRight").hasClass("black") === true && // NOT LETTER A $(".CenterLeft").hasClass("black") === false && $(".CenterTop").hasClass("black") === false && // ETC.. ){ // IF ITS CORRECT console.log("correct! go from level 0 to..") Level++; $("#alert-fact").animate("Alert", {duration:2000, easing: 'ease'}); $(".CenterBottom").animate("Correct", {duration:2000, easing: 'ease'}); $(".CenterRight").animate("Correct", {duration:2000, easing: 'ease'}); console.log(Level); // SOMETHING IS MISSING } else if ( $(".CenterBottom").hasClass("black") === true && $(".CenterRight").hasClass("black") === false || $(".CenterRight").hasClass("black") === true && $(".CenterBottom").hasClass("black") === false ) { $("#alert-missing").animate("Alert", {duration:2000, easing: 'ease'}); if ($(".CenterBottom").hasClass("black") === true) { $(".CenterBottom").animate("Correct", {duration:2000, easing: 'ease'}); }; if ($(".CenterRight").hasClass("black") === true) { $(".CenterRight").animate("Correct", {duration:2000, easing: 'ease'}); }; // WRONG } else { $("#alert-wrong").animate("Alert", {duration:2000, easing: 'ease'}); };//};//if (Level = 1){ // LETTER = B//};});
  6. Hi, I got a form which I use to take payments via PayPal. All is setup but one form field. To write the "item_name" for PayPal i use this piece of code: document.getElementById('item').value = "Week: " + week + ", Load: " + loading + ", Add. Hours: " + chours + ", Dest: " + postcode Selection fields are: week, loading and chours postcode is an input field, type text I want to get the postcode entered by the user into the item field and use it as the item_name for PayPal. I tried pcode = document.getElementById('postcode') postcode =pcode.value postcode = document.FormName.ElementName.value and more other suggestions form the internet, but none is working.postcode is always empty or undefined form field is: <input type="text" id="postcode" name="postcode" required /> Please someone help me out!
  7. On my register page when i enter character to username field google chrome console will give me this error: Uncaught TypeError: Cannot read property 'name' of undefined Fix would be awesome
  8. Hi, i need help for this error, I keep getting this error -->> "Unable to get value of the property 'innerHTML': object is null or undefined" when am running the program in IE & nothing is running in other web browsers... Below is the javascript (JScript.js) code: var output = document.getElementById('output'), pressed = {}; window.onkeydown = function (e) { if (pressed[e.which]) return; pressed[e.which] = e.timeStamp;}; window.onkeyup = function (e) { if (!pressed[e.which]) return; var duration = (e.timeStamp - pressed[e.which]) / 1000; output.innerHTML += '<p>Key ' + e.which + ' was pressed for ' + duration + ' seconds</p>'; pressed[e.which] = 0;}; Here is my asp code (test.aspx): <html><head><title>XXX</title></head><body> <h1>Keystroke Dynamics</h1> <p>Try pressing some keys on your keyboard ...</p> <script type="text/javascript" src="JScript.js"></script> <div id="output"></div></body></html> May I know the problem that cause this error & how can I correct it?? I tried the same program in php and it works but not in asp.net 2010...Thank you...
  9. I am trying to create my own Image( ); Object. This is how the build in Image function works: var img = new Image(); // Create new img element img.src = 'myImage.png'; // Set source path ctx.drawImage(img,0,0) is going to draw the image loaded from the img.src property. But I don't understand why.. Why am I not required to type: ctx.drawImage(img.src,0,0) ?? In fact, that breaks the script. Saying Type Error Please help me out here, I want to create my own "new Image()" with custom properties and methods..
  10. Hello, attached is a Javascript exercise for school that I'm having some troubles with! Any help/explanation is greatly appreciated! List.zip
  11. Hello internet. I would like to get a hit counter on my website but the only counters I have been able to find across the internet make me accesses someone else's site. I would like to contain the counter in my own site with my own code. Recommendations are appreciated. Thanks!
  12. Hello & Thanks ,I am looking for a tutorial of sorts :Something with a view of html , javascript , and css , all on the same window ,and how they fit together . Perhaps a small webPage , with pointers & arrows with comments .THanks...Vernon
  13. Nice be with you everyone! My problem is: How to put JQuery inside JavaScript Protoype? Here's my code: <script type="text/javascript"> $(document).ready(function(){ String.prototype.maxlength=function(a){ return this.attr("maxlength", a); } $("#name").maxlength(32); }); </script> And this... <body> <p>Name: <input id="name" type="text" name="name" value=""></p> <input type="submit" value="submit"> </body> My reason of using this prototype is to simplify my codes. Thank you.
  14. dewinky

    Vexing issue!

    I have a few questions i wish to see if anyone can assist me with:1. is it possible to have javascript dynamically adjust the height or width of a cell on a drag and drop event?, would i be better off using divs instead of table elements (easier to layout with my limited css skills). 2. would i be able to dynamically rotate the image of the dominoe, depending on which side of the dominoe is played and how could i do that? would i have to code something in javascript ondrop event 3. to enable select cells to allow dominoes to be dropped on them. 4. why does a dropped image takes one an opaque color? below is an image of my shoddy work and attached is the html output <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title></title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" /> <link rel="stylesheet" href="/resources/demos/style.css" /> <link rel="stylesheet" href="../dominoes/css/dominoes.css" type="text/css" /><!--[if IE]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <script> function allowDrop(ev) { ev.preventDefault(); } function drag(ev){ ev.dataTransfer.setData("Text",ev.target.id); } function drop(ev) { ev.preventDefault(); var data=ev.dataTransfer.getData("Text"); ev.target.appendChild(document.getElementById(data)); } </script> <script> $(document).ready(function(){ } );</script> </head> <body><div id="board" ><div id='playArea' ><table id='h1Row'><tr><td id='cell_0' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_1' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_2' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_3' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_4' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_5' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_6' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td></tr></table><table id='v1Row'><tr><td id='cell_7' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_8' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_9' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td></tr></table><table id='h2Row'><tr><td id='cell_17' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_16' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_15' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_14' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_13' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_12' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_11' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_10' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td></tr></table><table id='v2Row'><tr><td id='cell_18' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_19' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_20' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td></tr></table><table id='h3Row'><tr><td id='cell_21' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_22' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_23' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_24' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_25' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_26' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td><td id='cell_27' ondrop='drop(event)' ondragover='allowDrop(event)' class='h1Row'></td></tr></table><div id="Play2Right" ><div style="background-color: blue;" class="bones_Play2Right">55</div><div style="background-color: blue;" class="bones_Play2Right">53</div><div style="background-color: blue;" class="bones_Play2Right">41</div><div style="background-color: blue;" class="bones_Play2Right">65</div><div style="background-color: blue;" class="bones_Play2Right">11</div><div style="background-color: blue;" class="bones_Play2Right">32</div><div style="background-color: blue;" class="bones_Play2Right">51</div></div><div id="Play2Top" ><div style="background-color: red;" class="bones_Play2Top">30</div><div style="background-color: red;" class="bones_Play2Top">63</div><div style="background-color: red;" class="bones_Play2Top">64</div><div style="background-color: red;" class="bones_Play2Top">20</div><div style="background-color: red;" class="bones_Play2Top">52</div><div style="background-color: red;" class="bones_Play2Top">00</div><div style="background-color: red;" class="bones_Play2Top">54</div></div><div id="Play2Left" ><div style="background-color: green;" class="bones_Play2Left">43</div><div style="background-color: green;" class="bones_Play2Left">33</div><div style="background-color: green;" class="bones_Play2Left">31</div><div style="background-color: green;" class="bones_Play2Left">44</div><div style="background-color: green;" class="bones_Play2Left">22</div><div style="background-color: green;" class="bones_Play2Left">42</div><div style="background-color: green;" class="bones_Play2Left">40</div></div><div id="Play2Active" ><img id="img_21" draggable="true" ondragstart="drag(event)" class="bones_Play2Active" src="/dominoes/css/images/21.png" alt="21" ><img id="img_10" draggable="true" ondragstart="drag(event)" class="bones_Play2Active" src="/dominoes/css/images/10.png" alt="10" ><img id="img_66" draggable="true" ondragstart="drag(event)" class="bones_Play2Active" src="/dominoes/css/images/66.png" alt="66" ><img id="img_62" draggable="true" ondragstart="drag(event)" class="bones_Play2Active" src="/dominoes/css/images/62.png" alt="62" ><img id="img_61" draggable="true" ondragstart="drag(event)" class="bones_Play2Active" src="/dominoes/css/images/61.png" alt="61" ><img id="img_50" draggable="true" ondragstart="drag(event)" class="bones_Play2Active" src="/dominoes/css/images/50.png" alt="50" ><img id="img_60" draggable="true" ondragstart="drag(event)" class="bones_Play2Active" src="/dominoes/css/images/60.png" alt="60" ></div></div></div> </body></html>
  15. I have the need to have custom JSP tags in my web application.My custom tag works well when I run the application.Since I use Ajax (Javascript + Servlet + JSON) i tried to create my custom tag as a DIV element child in my Ajax Callback function.I tried using innetHTML method and createElement methods, and none of them works.So, I was wondering is this possible to do (or not) and how if it is?Thank You.
  16. Hi, I'm trying to replicate CSS3 transition effects for older versions of IE that don't support these transition effects. I'm trying to use the jQuery: $('#myelement').fadeIn(); However, I'm exceptionally bad at understanding Javascript and need some help making this code do what I want. What I want is when you hover over an image with the class "left1", I want it to grow to the specifications I have in my styelsheet for left1:hover. Of course, while transitioning. I already have the code exactly how I want it for CSS and HTML and already have jQuery linked up with my page. Now how do I integrate the code above for transitioning it? Thanks! P.S. I am aware that having the transition effects while trying to get the jQuery working can cause complications, so when I test it out I will/am removing the transition properties from the stylesheet.
  17. Nice be with you everyone! After I've learned setting JQuery selectors in a variables for optimisation.Example: $(document).ready(function(){ $("form").submit(function(){ var a=$("#position"); var b=$("#job"); var c=$("input#religion"); var d="Others"; if (a.val() == "" && b.val() == d ){ b.val("").focus(); return false; } if (c.val() == d){ c.val("").focus(); return false; } }); }); My related question is: Can I set JQuery methods in a variables for optimisation?Example: $(document).ready(function(){ var a=attr("maxlength", 32); $("#specialty").a; }); Thank you.
  18. Currently I'm learning Ajax with Java.The innerHTML method works when I'm retrieving simple string data from the servlet, and when I need to update only one HTML element.Since I have the need to update more HTML elements it occurred to me that I can use JSON object with several properties (HTML tag data for each element needed updating).After trying that I've noticed that innerHTML method doesn't work, when I try to process the retrieved data in the Callback function.My question is, why is this happening?Did someone had a similar problem when using JSON with Javascript.Just for the record, when I use innerText method I successfully update the HTML elements with JSON properties data, only they update as text and that's what I don't need. (See the video) Thank You.
  19. Hello,I'm new here and to be honest it's the first time I am writing into a Forum. Until now I was only reading through various posts which considerd the same problem as I had. But now I really have no idea what to search and where my problem is. Down here is the PHP Script I have written for a Prom Vote in a nearby school. It would be really great if someone could find my mistake and correct me. <!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8" /> <title></title> </head> <body> <?php$con = mysql_connect("localhost","xxx","xxxxxxxxx");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db(bgschwechat) or die( "Unable to select database");$abfrage = "SELECT * FROM teilnehmer";$ergebnis = mysql_query($abfrage);$abfrage2 = "SELECT * FROM teilnehmer";$ergebnis2 = mysql_query($abfrage2);echo '<script>';echo 'var stimmzahl = array();';echo 'var name = array();';echo '</script>';while($row = mysql_fetch_object($ergebnis)) { echo '<script>'; echo 'stimmzahl['; echo $row->id; echo '] = 0; '; echo 'name['; echo $row->id; echo '_name'; echo '] = '; echo $row->name; echo '; '; echo 'function '; echo $row->id; echo 'plus() {'; echo 'stimmzahl['; echo $row->id; echo ']++; '; echo 'document.getElementById("'; echo $row->id; echo 'result").innerHTML = stimmzahl['; echo $row->id; echo ']; '; echo '}'; echo 'function '; echo $row->id; echo 'minus() {'; echo 'stimmzahl['; echo $row->id; echo ']--; '; echo 'document.getElementById("'; echo $row->id; echo 'result").innerHTML = stimmzahl['; echo $row->id; echo ']; '; echo '}'; echo '</script>'; } echo '<table class="teilnehmer-liste">'; while($row = mysql_fetch_object($ergebnis2)) { echo '<tr>'; echo '<td>'; echo $row->name; echo '</td>'; echo '<td>'; echo '<button id="'; echo $row->id; echo 'plus" onClick= "function '; echo $row->id; echo 'plus()">+</button>'; echo '</td>'; echo '<td>'; echo '<button id="'; echo $row->id; echo 'minus" onClick=" function '; echo $row->id; echo 'minus()">-</button>'; echo '</td>'; echo '<td>'; echo '<div id="'; echo $row->id; echo 'result">/</div>'; echo '</td>'; echo '</tr>';}mysql_free_result($ergebnis);?></table> </body> </html> The PHP Code works pretty fine but I am not happy with the result because the + and - Buttons don't work :/ Here's the result of the PHP Code in HTML : <!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8" /> <title></title> </head> <body> <script>var stimmzahl = array();var name = array();</script><script>stimmzahl[1] = 0; name[1_name] = Test Person 1; function 1plus() {stimmzahl[1]++; document.getElementById("1result").innerHTML = stimmzahl[1]; }function 1minus() {stimmzahl[1]--; document.getElementById("1result").innerHTML = stimmzahl[1]; }</script><script>stimmzahl[2] = 0; name[2_name] = Test Person 2; function 2plus() {stimmzahl[2]++; document.getElementById("2result").innerHTML = stimmzahl[2]; }function 2minus() {stimmzahl[2]--; document.getElementById("2result").innerHTML = stimmzahl[2]; }</script><table class="teilnehmer-liste"><tr><td>Test Person 1</td><td><button id="1plus" onClick= "function 1plus()">+</button></td><td><button id="1minus" onClick=" function 1minus()">-</button></td><td><div id="1result">/</div></td></tr><tr><td>Test Person 2</td><td><button id="2plus" onClick= "function 2plus()">+</button></td><td><button id="2minus" onClick=" function 2minus()">-</button></td><td><div id="2result">/</div></td></tr></table> </body> </html> It would be really great if someone could help me I need to find a solution as soon as possible because I only have rare time to finish the project. Thanks in advance. ASavic P.S. Here's the Website Link - http://www.cryze.com/bgschwechat/test.php - sometimes offline because it's in development. ^^
  20. Nice be with you everyone! While reading http://www.w3schools...s_obj_array.asp I've noticed two confusing arrays... 2: Condensed: var myCars=new Array("Saab","Volvo","BMW"); 3: Literal: var myCars=["Saab","Volvo","BMW"]; My question is: What is the difference between Literal arrays & Condensed Arrays? & which of them is better to use? Thank you.
  21. Nice be with you everyone! My problem is: Every time I click "#show" my prompt is continuously appearing though I click OK, cancel or close? Here is my code: <script type="text/javascript" src="javascripts/jquery-1.9.1.min.js"></script> <script> $(document).ready(function(){ $("#weight").hover(function(){ $("#show").css("display", "block"); }, function(){ $("#show").css("display", "none"); $("#show").mouseenter(function(){ $(this).data("mouse", "enter"); if ($(this).data("mouse") == "enter"){ $(this).css("display", "block").click(function(){ var converted = prompt ("Convert poud to kilograms:","")answer = converted * 0.45359237; // 1 lb = 0.45359237 kganswer = answer.toFixed(2); if (!isNaN(converted)) { // If not illegal number if (converted != 0) { // If not empty valuealert(converted + " poud = " + answer + " kilograms");$("#weight").val(answer); } else alert("Error: Empty value!"); // If empty value } else alert("Error: Illegal number!"); // If illegal number });}});});}); </script> Take a look my attached picture. Thank you.
  22. Nice be with you everyone! My question is: What is the usage of console.log in jQuery? Thank you.
  23. Nice be with you everyone! My problem is how to call javascript function inside jquery? <script type="text/javascript" src="javascripts/jquery-1.9.1.min.js"></script> <script> function li(){ var A=$(this).text();$(.text(A.substr(0,19)); $("#job").removeAttr("name value"); $("#position").attr({"name":"jobApplied", "value":A }); $(.css({"color":"#000", "background":"#fff" }); $(C).css({"color":"#a9a9a9", "background":"#d9d9d9"}).text(D); $("#job").css({"background":"#d9d9d9" }); } $(document).ready(function(){$("#ul1 li ul a").on("click",function(){ var B="#cut1", C="#cut2", D="Medical positions"; /* I want to call function li() here but it is not working */ });}); $(document).ready(function(){$("#ul2 li ul a").on("click",function(){ var B="#cut2", C="#cut1", D="Technical positions"; /* I want to call function li() here but it is not working */ });}); </script> Thank you.
  24. Hi All, I am having issues with my search bar on my website www.uHeadphones.Com. When I click the search bar to input a keyword or anything it is refreshing my index page. If I am on my product page it is refreshing back to my index page. Pretty much it is acting as my logo button in the top left of the header. Can someone please help me out with this. I can't figure out what is wrong with the code. I am decent with HTML but not so great with JavaScript. Below I am going to post my header HTML code as with as my script.js JavaScript code. HTML in Header: actual search bar code in red <!-- START HEADER --><script type="text/javascript" src="themes/default/inc/scripts.js"></script><script type="text/javascript" src="themes/default/inc/jquery.megamenu.js"></script><script language="JavaScript" src="https://seal.networksolutions.com/siteseal/javascript/siteseal.js" type="text/javascript"></script> <div class="searcharea"> <div class="custom-search" id="ctl00_ctl02_searchBox"> <input type="text" class="textbox custom-search-field" type="text" maxlength="100" id="search-textbox" class="textbox" value="Enter keyword(s), item #, etc..." onblur="if (this.value == '') {this.value = 'Enter keyword(s), item #, etc...';}" onfocus="if (this.value == 'Enter keyword(s), item #, etc...') {this.value = '';}" /> <input type="image" class="custom-search-button" alt="Go" src="themes/default/images/btn_header_search.gif" id="search-button" name="ctl00$ctl02$go" /> </div></div> JavaScript: Script.JS file:jQuery(function(){ var SelfLocation = window.location.href.split('?'); switch (SelfLocation[1]) { case "justify_right": jQuery(".megamenu").megamenu({ 'justify':'right' }); break; case "justify_left": default: jQuery(".megamenu").megamenu(); } }); function loadSearch() { var searchText = document.getElementById("search-textbox"); var searchButton = document.getElementById("search-button"); searchButton.onclick = function() { if (searchText.value != '') { window.location = '/search.aspx?find=' + encodeURIComponent(searchText.value).replace(/%20/g, '+'); return false; } };} MC.addLoadEvent(loadSearch);// Start Simple Text Popup//(function($){// $.fn.scSimpleText = function(options){ // var defaults = { // popCloseTxt : '' // }; //var settings = $.extend({},defaults,options); //return this.each(function(){ // var nextElm = $(this).next(); // var closeElement = $(document.createElement("a")).attr("href","").text(settings.popCloseTxt).addClass("scSimpleTextClose").click(function(e){nextElm.fadeOut("slow"); e.preventDefault();}); //$(this).click(function(e){ // nextElm.fadeIn("slow"); //nextElm.append(closeElement); // e.preventDefault(); // }); // });// }// End Simple Text Popup /**********************************************************************************************************//****************************** Place all add on JS above here, please minify *****************************//**********************************************************************************************************/ /************************************* Document on Load jQuery Functions **********************************/ jQuery(document).ready(function() { // simple text popup for privacy link // $("#simpleTextLink").scSimpleText({popClose:".simpleTextRight"});
  25. I have a main window named worklistManager.jsp. worklistManager.jsp has a pop up window named processManager.jsp. Again, processManager.jsp has another pop up window, named eventLog.jsp. Once again eventLog.jsp has a pop up window named eventUsers.jsp. eventUsers.jsp has a dojox/grid/DataGrid and a button. After selecting a particular row in the grid, then clicking the button, it has to place the value into the textbox of eventLog.jsp after closing eventUsers.jsp. So far, I have tried the script below to accomplish this, but it's not working as I hoped. <script type="text/javascript"> function getEventLogUserSelect(){ if(dijit.byId('dynamiceventusergridCWUSER')){ var selctedItem = dijit.byId('dynamiceventusergridCWUSER').selection.getSelected(); if(selctedItem.length){ dojo.forEach(selctedItem, function(selectedItem){ if(selectedItem !== null){ dojo.forEach(dijit.byId('dynamiceventusergridCWUSER').store.getAttributes(selectedItem), function(attribute){ var value = dijit.byId('dynamiceventusergridCWUSER').store.getValues(selectedItem, attribute); if(attribute == "USERID"){ window.opener.SetValue(value); window.close(); } }); } }); //alert("grid row selected"); }else{ alert("grid row not selected"); } } if(gbshowgridFlag==false){ alert("grid not loaded"); } } function SetValue(val){ var txt = document.getElementById('CWPROCESSEVENTLOG.USER_ID'); txt.value = val; } </script>
×
×
  • Create New...