JavaScript - Your Task Is To Make The Cyclic Table, As In The Sketch Below.
This is urgent needs to be done by sunday.
Table must be generated dynamically, depending on the number of columns and rows that the user enters. Table is filled with numbers, starting from the bottom-right corner, and then sequentially in a circle, in clockwise, until all fields are filled. Note: technology that is certified as HTML, CSS, JavaScript, jQuery, AngularJS. The interface should be crossbrowser compatible (IE8 +, Chrome, Firefox, Opera, Safari). When should be optimized and user interface tidy and generally correspond to the sketch. Reply With Quote 01-23-2015, 07:36 PM #2 Philip M View Profile View Forum Posts Supreme Master coder! Join Date Jun 2002 Location London, England Posts 18,371 Thanks 204 Thanked 2,573 Times in 2,551 Posts Wth 234 posts you should know very well that this forum is not a free coding service. As a general rule, the people helping out in this forum don't write code for others (especially code that appears to be for homework), but try to help with fixing code that doesn't work. You may perhaps get someone to write this script for you, but you'll be far more likely to get help if you have made a substantial effort and written some code yourself. Then someone here will almost certainly help you correct/improve your work. Why have you left starting your assignment so late? The outlook for your future employment appears doubtful, to say the least. Similar TutorialsHi, I am coding a script and the client is asking for in page sketching, exactly like this: http://mugtug.com/sketchpad/ and once click on save it will save the sketch to sketches folder, desperately need this Hi there, I'm looking to create something similar to the online javascript terminal located at http://cb.vu I don't know very much about it so I guessed I'd post here and hope to find someone who knows what they're doing. Thanks! Hey I am having trouble getting my javascript code to work. It seems to not register the event or even carry out the code. I have attached my code. index.php 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" /> <link rel="stylesheet" href="StyleSheet.css" type="text/css" /> <script type="text/javascript" src="register.js"></script> <title>CollegeStop.com - Your stop for used college books!</title> </head> <body> <div class="wrapper"> <div class="logo">Logo goes Here</div> <div class="login_bar"> <form action="" method="post"> <table> <tr> <td>Email:</td> <td><input type="text" name="email"></td> <td>Password:</td> <td><input type="password" name="password"></td> <td><input type="submit" name="login" value="Login"/></td> </tr> </table> </form> <p>Not yet a member? <a href="index.php">Register</p> </div> <div class="nav_bar"> <ul class="menu"> <li class="home"><a href="index.php">Home</a></li> <li class="browse"><a href="browse.php">Browse</a></li> <li class="contact"><a href="contact.php">Contact</a></li> </div> <div class="content_container"> <div id="recent"> <p>box of recent additions to the site</p> </div> <div id="about_us"> <p>Hi and welcome to CollegeStop.com. This is a site dedicated to hopefully getting you a bit of a return on the money you spent on books.</p> </div> <div id="registration"> <h5>Your password must be atleast six characters in length. Please enter a valid email as it will be our method to ensure you get an account!</h5> <form id="registration_form" action="" method="post"> <table> <tr> <td>First Name:</td> <td><input type="text" id="firstName" name="first_name"/></td> </tr> <tr> <td>Last Name:</td> <td><input type="text" id="lastName" name="last_name"/></td> </tr> <tr> <td>Email:</td> <td><input type="text" id="intEmail" name="email_first"/></td> </tr> <tr> <td>Retype Email:</td> <td><input type="text" id="secEmail" name="email_second"/></td> </tr> <tr> <td>Password:</td> <td><input type="password" id="intPass" name="pass_first"/></td> </tr> <tr> <td>Retype Password:</td> <td><input type="password" id="secPass" name="pass_second"/></td> </tr> <tr> <td><input type="submit" value="Register"/></td> <td><input type="reset" value="Clear Form"/></td> </tr> </table> </form> <script type="text/javascript" src="registerR.js"> </script> </div> </div> </div> </div> <div class="footer"><p>2012 © Hassan Said</p></div> </body> </html> register.js Code: function checkReg(){ var firstName = document.getElementById("firstName"); var lastName = document.getElementById("lastName"); var intEmail = document.getElementById("intEmail"); var secEmail = document.getElementById("secEmail"); var intPassw = document.getElementById("intPass"); var secPassw = document.getElementById("secPass"); if((firstName == "")||(lastName == "")||(intEmail == "")||(secEmail == "")|| (intPassw == "")||(secPassw =="")){ alert("Please fill in all fields!"); firstName.focus(); return false; } } registerR.js Code: document.getElementById("registration_form").onsubmit = checkRegister; I'm absolutely new to JavaScript and HTML, although I've done a fair amount with Visual Basic (VB6 and macros in Word and Excel). I'm trying to create a form with different sections. When the user checks a checkbox for a section, the table with the input areas for that section will appear; if the user changes his mind and unchecks the box, that table will go away. I've played with the visibility attribute, and that works - sort of. I can hide the table from view, but it's still there in the page, taking up as much room as it does whether visible or not. There's a big empty gap containing an invisible table or two if the user only selects the third or fourth section. Code: function showhide(element){ if(document.getElementById(element).style.visibility=="hidden"){ document.getElementById(element).style.visibility="visible"; document.getElementById(element).style.display="block"; }else{ document.getElementById(element).style.visibility="hidden"; document.getElementById(element).style.display="none"; } } And I played with the height attribute, and that works - to a point. I can only collapse the table ror height when there's nothing in it. But if there's text, or a text box, or a textarea box, the row will not go down to zero, even if that's what I set it to. Code: <tr ID="targetrow" style="height:0px;"></tr> I'm hoping the only solution isn't to write the table into the document on the fly when the box is checked, and then delete it if the box is unchecked. Any help? Ed Hi, have table with 5 rows. First 2 rows visible. Last 3 rows hidden - Code: <tr id="row1" style="display: none"> <tr id="row2" style="display: none"> <tr id="row3" style="display: none"> With onclick would like to make those rows visible to user - how can I do that? thank - john -Please delete- will make another thread with simpler explanation. Hello everyone, I am just learning the basics of javascript, and am finding myself stuck. Any help is greatly appreciated. So, I'm using the below javascript for expand / collapse text, it suffices well. However it will only collapse either table rows, or table data cells. Now, I know that these tags Code: {var trs = table.getElementsByTagName('tr'); {var a = trs[i].getElementsByTagName('td') Make the rows / data cells expand. However, I cannot seem to make it work on headers. To be lucid, I would like to know what I have to add, or edit to make the below code expand table headers (<th>), and perhaps div tags. The full javascript is thus : Code: window.onload = function() { var table = document.getElementById('stjorn'); if (table) { var trs = table.getElementsByTagName('tr'); for(var i = 0; i < trs.length; i++) { var a = trs[i].getElementsByTagName('td')[0].getElementsByTagName('a')[0]; a.onclick = function() { var span = this.parentNode.getElementsByTagName('span')[0]; span.style.display = span.style.display == 'none' ? 'block' : 'none'; this.firstChild.nodeValue = span.style.display == 'none' ? 'More' : 'Less';}; } } }; Thank you for your time. My issue is that I have a javascript function applied on page load via an addLoadEvent function call in the head to every row (dynamic number of records retrieved) on a table. On every row of the table I also have an element (image or button) that performs a different function that is assigned on the element itself. Unfortunately, when I click the element it also performs the function that was applied to the row in the page load. Is there any way to not call this function on element click? I know usually you include code, but due to the nature of the work I am limited in that respect. Basically its: Code: <script type="text/javascript"> addLoadEvent(function() { function1(1); }) //function1 makes the table rows do something appearance wise. </script> <tr> <td></td> <td></td> <td> <img src="pics/delete.png" alt="Delete" onclick="function2();"> </td> </tr> I apologize if my post doesn't conform to the general guidelines of proper posting on this board. I'm new on this site. Hello all i have to implement simple LIFO algorithm ( if i can call it like this .. ) say i have html table and and i fetching data i like thet the last data that fetched to be the first record in the table for example : im fetching the string "111" so it will be the first record next im fetching the string "222" now the string "111" will be the second and the string "222" will be the first .. and so on hi guys i having some problems with jquery plugin table sorter on a dynamic table. if i use it on a regular html table it works fine,but on my dynamic table its not working. if someone could look at my code and see if i done something wrong i would appreciate it . Thanks will43 Code: <script type="text/javascript" src="table sorter/jquery.tablesorter/jquery-latest.js" ></script> <script type="text/javascript" src="table sorter/jquery.tablesorter/jquery.tablesorter.js" ></script> <script type="text/javascript"/> $(document).ready(function() { $("#myTable").tablesorter(); } ); </script> <form id="form1" name="form1" method="post" action=""> <label for="Position">Position</label> <select name="Position" id="Position"> <option>QB</option> <option>HB</option> <option>FB</option> <option>WR</option> <option>TE</option> <option>RG</option> <option>RT</option> <option>C</option> <option>LG</option> <option>LT</option> <option>CB</option> <option>LB</option> <option>SS</option> <option>FS</option> <option>DE</option> <option>DT</option> <option>P</option> <option>K</option> </select> <input type="submit" name="Summit" id="Summit" value="Submit" /> </form> <p> </p> <p> </p> <table width="950" border="1" cellpadding="3" cellspacing="3" class="tablesorter" id="myTable"> <thead> <tr> <th bgcolor="#FF0000">id</th> <th bgcolor="#FF0000">Team</th> <th bgcolor="#FF0000">FirstName</th> <th bgcolor="#FF0000">LastName</th> <th bgcolor="#FF0000">Position</th> <th bgcolor="#FF0000">Year</th> <th bgcolor="#FF0000">Overall</th> <th bgcolor="#FF0000">Speed</th> </tr> </thead> <?php do { ?> <tbody> <tr> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['id']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['Team']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['FirstName']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['LastName']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['Position']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['Year']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['Overall']; ?></td> <td bgcolor="#FFFF00"><?php echo $row_Recordset1['Speed']; ?></td> </tr> </tbody> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> </table> hi all, i have a table, just a basic table with 6 rows. depending on the value of the first <td>thevalue</td> i want to start a end the existing table and start a new one. the newly added table (i hope) will contain all the remaining <tr><td></td></tr> nodes until i run into the next check that will close the newly added table and begin a new table again etc.... i can get the correct node (tr) after i find the value in the td im looking for, and then try a : document.createElement("table"); , but my problem is that this newly created table tag comes with an automatically created </table> element / tag, so i end up with just inserting a new blank table after a row instead of inserting a new table tag that has all the remaining tr and tds under it. hope that makes sense. my entire test page is: (click the text link and an alert will show the output with the new <table></table> after the row that my check is looking for (first td with a 2) -------------------------------------------------------------------- Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> <script type="text/javascript"> function reformatMe() { var divObj = document.getElementById('reformatMe'); var numRows = document.getElementsByTagName("tr"); var z = "1"; for (i = 0; i < numRows.length; i++) { if (numRows[i].childNodes[0].innerHTML == "2") { var markStart = numRows[i]; alert(markStart.nextSibling); var closeTable = document.createElement("/table"); var addTable = document.createElement("table"); //var tbody = document.createElement("tbody"); //addTable.appendChild(tbody); addTable.setAttribute("id", "subOptionID" + z); if(numRows[i+1] != null){ numRows[i].parentNode.insertBefore(addTable, numRows[i+1]); } z++; } } alert(divObj.innerHTML); } </script> </head> <body> <a href="#" onclick="reformatMe();">reformat table</a> <div id="reformatMe"> <table border="1" cellpadding="4" cellspacing="2" id="menuItemID1"> <tr><td>1</td> <td>1</td> <td>How would you like your food prepared?</td> <td>1</td> <td>1</td> <td>0</td></tr> <tr><td>1</td> <td>1</td> <td>Choose two of the following sides</td> <td>0</td> <td>2</td> <td>0</td></tr> <tr><td>1</td> <td>1</td> <td>What do you want on your Baked Potato?</td> <td>0</td> <td>2</td> <td>1</td></tr> <tr><td>2</td> <td>1</td> <td>What type of dressing do you want on your salad?</td> <td>1</td> <td>1</td> <td>1</td></tr> <tr><td>1</td> <td>1</td> <td>Do you want fries?</td> <td>1</td> <td>1</td> <td>0</td></tr> <tr><td>1</td> <td>1</td> <td>Do you want ketchup on your fries?</td> <td>1</td> <td>1</td> <td>1</td></tr> </table> </div> </body> </html> I want the dynamically add fields can be appear with a contain of php code, but I have not found the way, I wondering there who are willing to help me. my code as fallowing: Code: <!-- // another fields here //--> <div id="new_field"--></div> <script type="text/javascript"> var inputs = { fields: 0, target: "new_field", addInput: function() { if (this.fields != 5) { this.fields++; var newElement = document.createElement('div'); newElement.id = this.target + this.fields; newElement.innerHTML = "<?php if ($emails) { foreach ($emails as $result) { ?><b><?php echo $entry_emails; ?></b><br /><input type='text' name='emails[]' value='<?php echo $result; ?>' size='auto' maxlength='100%' /><?php } } ?>"; document.getElementById(this.target).appendChild(newElement); } else { alert("Only 5 fields allowed."); } }, };</script> i know it does not appear because the php code Quote: newElement.innerHTML = "<?php if ($emails) { foreach ($emails as $result) { ?><b><?php echo $entry_emails; ?></b><br /><input type='text' name='emails[]' value='<?php echo $result; ?' size='auto' maxlength='100%' /><?php } } ?>"; but please let me know is there another idea and pointer to make it work?, I would appreciate it and many thanks. I found this copy and paste java script for slide shows... I can only put 1 on the page then the other don't work... how do i edit it so i can put multiple on 1 page? http://www.javascriptkit.com/script/.../jsslide.shtml Code: <script language="JavaScript1.1"> <!-- /* JavaScript Image slideshow: By JavaScript Kit (www.javascriptkit.com) Over 200+ free JavaScript here! */ var slideimages=new Array() var slidelinks=new Array() function slideshowimages(){ for (i=0;i<slideshowimages.arguments.length;i++){ slideimages[i]=new Image() slideimages[i].src=slideshowimages.arguments[i] } } function slideshowlinks(){ for (i=0;i<slideshowlinks.arguments.length;i++) slidelinks[i]=slideshowlinks.arguments[i] } function gotoshow(){ if (!window.winslide||winslide.closed) winslide=window.open(slidelinks[whichlink]) else winslide.location=slidelinks[whichlink] winslide.focus() } //--> </script> Code: <a href="javascript:gotoshow()"><img src="food1.jpg" name="slide" border=0 width=300 height=375></a> <script> <!-- //configure the paths of the images, plus corresponding target links slideshowimages("food1.jpg","food2.jpg","food3.jpg","food4.jpg","food5.jpg") slideshowlinks("http://food.epicurious.com/run/recipe/view?id=13285","http://food.epicurious.com/run/recipe/view?id=10092","http://food.epicurious.com/run/recipe/view?id=100975","http://food.epicurious.com/run/recipe/view?id=2876","http://food.epicurious.com/run/recipe/view?id=20010") //configure the speed of the slideshow, in miliseconds var slideshowspeed=2000 var whichlink=0 var whichimage=0 function slideit(){ if (!document.images) return document.images.slide.src=slideimages[whichimage].src whichlink=whichimage if (whichimage<slideimages.length-1) whichimage++ else whichimage=0 setTimeout("slideit()",slideshowspeed) } slideit() //--> </script> <p align="center"><font face="arial" size="-2">This free script provided by</font><br> <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript Kit</a></font></p> I have a notification bar on a Blogger blog (so, little/no access to server side) that I would like to use JavaScript to make the notification bar appear only once per day for each user. The site is www.BenjerMcVeigh.com, and here is the code for the notification bar: Code: <style type='text/css'> #ut-sticky { background:url('http://3.bp.blogspot.com/-7oGSlq30cTw/Tv33CS4WGgI/AAAAAAAAA0w/HxId_tRUae8/s1600/ut-bg.png') repeat; color:#fff; text-align: center; margin:0 auto; border-top: 1px solid #fff; height:64px; font-size:13px; position:fixed; bottom:0; z-index:999; width:95%; border-top-left-radius:15px; border-top-right-radius:15px; display:block; font-weight: bold; font-family: arial,"Helvetica"; font-color:#fff; } #ut-sticky:hover {background:#333;} #ut-sticky p{line-height:5px; font-size:18px; text-align:center; width:95%; float:left;} #ut-sticky p a{font-size:18px; font-weight:bold; font-family:"Arial"; color:#cfe7d1;} .ut-cross{display:block; position:relative; right:15px; float:right;} .ut-cross a{font-size:18px; font-weight:bold; font-family:"Arial"; color:#cfe7d1; line-height:30px;} </style> <div id='ut-sticky'> <p><a href='http://bit.ly/yq10RE' target='_blank'>Use Google Reader? Why not add www.BenjerMcVeigh.com to your Google Reader list?</a>*****<a href='http://bit.ly/yq10RE' target='_blank'><img alt='Add to Google' border='0' src='http://gmodules.com/ig/images/plus_google.gif'/></a></p> <div class='ut-cross'><a href='javascript:hide_cross();'>X</a></div> </div> <script language='JavaScript'> function hide_cross() { crosstbox = document.getElementById("ut-sticky"); crosstbox.style.visibility = 'hidden'; } </script> I'm very much a novice and appreciate your help...not really sure where to start. Thanks! Code: function get_check_value() { var c_value = ""; for (var i=0; i < document.callflow.flow.length; i++) { if (document.callflow.flow[i].checked) { c_value = c_value + document.callflow.flow[i].value + "\n"; } } c_value = "You did the following steps:\n" + c_value; alert(c_value); return false; } how do you make this code pop up the values of (c_value) instead of an alert?.. thanks Hello, How hard is it to make a "mixer" like this one here? http://mixville.ru/choco/create Having only html and css knowledge and minimal javascript(learning it, very interesting language) I can suppose it's like a table filled with buttons which once clicked move to another table on the left side? Which is made like an array or something. Im a newbye i know. Hope you can guide me in the right direction or atleast tell me the subjects that I need to learn to make this myself. P.S. this is in no way a commercial or spam since the website is russian I am terrible at this. I want to get this functionality seen here http://davidlynch.org/js/maphilight/docs/demo_usa.html (image map areas highlighting on mouseover) to work on this here http://scratchitrich.com/test/ can anybody walk me through how to make this work? Thanks! Hello, I Installed a Javascript on my site but the font is very small The code Code: <script type="text/javascript"> TargetDate = "03/12/2010 12:00 PM"; BackColor = ForeColor = CountActive = true; CountStepper = -1; LeadingZero = true; DisplayFormat = "%%D%% يوم, %%H%% ساعة, %%M%% دقيقة, %%S%% ثانية"; FinishMessage = "It is finally here!"; </script> <script type="text/javascript" src="http://f1zcdn.appspot.com/js/countdown.js"></script> How can i make the font in "yellow" bigger ? Thank you Hey guys, im in need of some more java script help (by the way thanks for all the other times you guys have helped me) need to create a search box that whatever is in the search box will come up at the end of the URL https://****/DirectConnect/Getpremie...Chassis|X##### the last 6 charecters should be replaced with what ever number that in the search box so X##### should be replaced by 123456 for example or any other number HI evey one I want to make a vote music web site , some thing like this : http://www.pmctop20.com/ we can drag each of the items in the left panel and drag it to the vote rows . How can I do so? It's a jquery script Thanks |