JavaScript - Some Help Needed From Js Gurus :)
basically i need to create a form that has three questions, but the answers have to match my answers...what is the best way to do this (without DB)...i was thinking create an array with the 3 answers then match the fields with the answers in my array...any help is appericated!
thanks guys Similar TutorialsI have a small need of a thing to be done. I'm willing to pay $4 via PayPal to anyone who's willing to help. I need this specific module developed;; ---(with all the pages and the form)-- User goes to PAGE1 -- a html page with a form shows up -- the form has 2 radio buttons, A and B (2 choices, either 1 to be made) and a submit button -- when any choice from A or B has been made, and submit button has been clicked, a java-script on the back-end does this;; - read value=V from value.txt --- if V=0 and radiobutton=A, re-write V=A in value.txt, proceed to page-A --- or --- if V=0 and radiobutton=B, re-write V=B in value.txt, proceed to page-B --- or --- if V=A or V=B, do not leave PAGE1 and go no-where This is the plan what comes up in my mind. But to discuss further, what I want is a user to get 2 options, and two pages linked to both the options. And once the user has made the choice, he can't go back to PAGE1 and make the other choice and go to the other page.. Once the choice has been made, the PAGE1 is useless. Also, this has to work on a web-server, i.e. not locally. All the files PAGE1.html, page-A.html, page-B.html and value.txt are be stored online. I have a very complicated need for a regex and I need to match certain strings because of pageload tracking. Basically, a param is passed in the url, and on the landing page, I need to read this param and if it matches (see below), then set something to true. Basically this is what I need to match. The are matches of inclusion. case insensitive % = can be anything, number or letter. 1 or more. # = can be any number {color} = can be one of the following: red, orange, silver, green, blue, yellow ********************** shoes_cr_% shirt_recom_img# shirt_recom_name# shirt_favorite_location_% pants_%_lg_1010#_# pants_{color}_c# pants_{color}_d# pants_{color}_long# pants_{color}_g# pants_{color}_h# pants_{color}_j# pants_{color}_k# pants_{color}_lv# pants_{color}_n# pants_{color}_cr_findpants# pants_{color}_cr_img# pants_{color}_cr_name# pants_{color}_cr_seemore# pants_retro_ts# pants_%_r# pants_%_f# ******************************************************** Yes, that is a mouthful. I'd be willing to paypal you $50 for your time, if it works. Need it fast. not sure if the above will do the following: I need to intentionally exclude the following. But I believe by matching for inclusion, this will automatically work. exclude: shoes_{color}_a# shoes_{color}_b# shoes_{color}_i# Thanks Hi everyone, Im have a problem here with having a mouseover hilight effect on my table. Can anyone help ? Im not great at js. PHP Code: if($i%2 == 0){$rcolor='#313131';}else{$rcolor='#212121';} $sql=mysql_query("SELECT * FROM ranks_memberxp WHERE xp <=$mem[points] ORDER BY xp DESC LIMIT 1"); $rank=mysql_fetch_assoc($sql); $sql=mysql_query("SELECT color FROM member_groups WHERE id=$mem[gid]"); $mem_color=mysql_result($sql,0); $out[body].=" <tr style='background-color:$rcolor' height='24' > <td valign='center' width='2%' align='center' background='$config[cellbgx]'><font color='white' size='3'> $i "; if($xp2[xperience_lastupdate] >= $xp2[xperience]){ $arrowicon=$out[body].="<img src='./images/rank_up.gif' border='0'>"; } else if($xp2[xperience_lastupdate] <= $xp2[xperience]){ $arrowicon=$out[body].="<img src='./images/rank_down.gif' border='0'>"; } else{ $arrowicon=""; } $out[body].=" </font></td> <td valign='center' width='7%' align='center'><img src='./images/flags/{$mem[country]}_small.gif' border='0' /></td> <td valign='center' width='7%' align='left' background='$config[cellbgx]'><a href='./profile.php?account=$mem[id]'><b><span style='color:$mem_color' size='3'>$mem[name]</span></b></a></td> <td valign='center' width='7%' align='center' background='$config[cellbgx]'><img src='$rank[image]' height='15px' width='15px' title='$rank[name]'/></td> <td valign='center' width='7%' align='center'>$pmerleague $pmerforum</td> <td valign='center' width='7%' align='center'><a href='aim:goim?screenname=$mem[aim]&message=Hello, are you there?'><img border='0' align='absmiddle' src='http://360IcoNs.com/images/aim.gif'></a></td> <td class='tag' valign='center' width='19%' background='http://www.360icons.com/theme/dark-grunge/images/box.png' style=' padding-left:130px;' align='center'>$mem[xbl]</td> <td valign='center' width='7%' align='center'><b>$mem[points]</b></td> <td valign='center' width='8%' align='center'>$online</td> <td valign='center' width='8%' align='center'>$mem[Joined]</td> </tr></text>"; CAN SOMEONE TRY EDIT THAT TO GET IT TO WORK ? I just cant get it.... Hello all, I'm nick3d, from the UK. I'm new to this forum... Anyway... I am struggling with a project, basically what I want is. I want a slide in menu bar to the left of my screen, which is also a floating menu, so it follows my page when scrolled up and down, also, in the menu on the left I want the links to be like this UserCP FAQ Calender etc... Then once link clicked I want this to happen UserCP Change View Edit FAQ Calender, etc. so tabs can be opened, are there any available scripts out there which does all this?? Or could any one point me in the right direction? Hi all, I'm a new member of this forum. I need help. My validation code checks for errors while filling out a permission form. If any of the fields are invalid it alerts a javascript box. But it disappears only after 2 mouse clicks. Can anyone help me out? Thank you. prik Hello guys i really need your help please. i need a code that when a button or image is clicked then a div's width and height are changed. Ive managed to get a few codes that does this, but the real problem is that, the contents of the div is an embedded flash file and i thought that by setting the flash width and height to 100% then the flash would fit to the new size of the div, but it just didnt work. I need a code that when a button is clicked then the div's and the flash's width and height are changed. please have a look at the temp website (http://latinunit.net/temp/ , you will understand where im coming from. on the right hand side i have a flash chat in a div , div is controled by a script that allows it to follow the scrollers up and down. My goal is to add a little button in the same div that says expand or maximise so when clicked the the div expands aswell as the flash file. i have spent 2 days on this little issue i just cant make it work, so please anyone can help me. Hello! I am currently having some troubles finishing my website. www.djbobambo.com. I would like the music to play on every html page but the problem is that when i change a pages the music resets and begins from the beginning. I would like it to continue so when you change from page to page the music keeps playing. Any ideas? Thanks! This is the code i use: Code: <img id="music" onclick="musicfunc()" src="images/buttons/on.png" width="195" height="20" style="float: center; padding-right: 50px; padding-top: 58px;"> <OBJECT id="MediaPlayer" width="1" height="1" style="position:absolute; left:0;top:0;" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"> <PARAM name="URL" value="home.mp3"> <PARAM name="AutoStart" value="True"> <PARAM name="PlayCount" value="9999"> </OBJECT> <script type="text/javascript"> var musicstat = "1";function musicfunc(){if(musicstat == "0"){document.getElementById ('music').src="images/buttons/on.png";musicstat = "1";document.getElementById("MediaPlayer").setAttribute("URL", "home.mp3");}else if(musicstat == "1"){document.getElementById ('music').src="images/buttons/off.png";musicstat = "0";document.getElementById("MediaPlayer").setAttribute("URL", "");}} </script> Hi I'm trying to download the security image from this site (at the bottom): http://pacesalsa.promotionexpert.com...2/register.jsp However, every time one refreshes the image, the image changes (obviously). So, I'm trying to figure out how to download the current image on the page to a jpg or png (or any image file type). Could someone please tell me how to do this? Thanks. I have been trying for hours to do the following: - Change the background of a div by clicking a link from another div tag. - It also needs to change back when clicked again. I know there are alot of experienced coders out there and I'm eager to learn... help would be appreciated! I have created most of the code however I would like to expand my options. Basically the code changes an image when a user makes a selection from a drop down menu. <head> Code: <script language="javascript"> function linkrotate(which){ var mylinks=new Array() mylinks[0]="http://www.#.com" mylinks[1]="http://www.#.com" mylinks[2]="http://www.#.com" window.location=mylinks[which] } function showimage() { if (!document.images) return document.images.pictures.src= document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value } //--> </script> <body> Code: <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="100%"><form name="mygallery"><p><select name="picture" size="1" onChange="showimage()"> <option selected value="image1.jpg">Option 1</option> <option value="image2.jpg">Option 2</option> <option value="image3.jpg">Option 3</option> </select></p> </form> What I would like to do it have two drop down menus that work together instead of one - providing a more accurate image for the user. Right now the user has one option to select from the drop down menu in which the image is changed. I'd like to be able to have the user choose from two drop down menus. For example: Drop down menu number 1 Shoe Color: Black or Red Drop down menu number 2 Shoelace Color: White or Brown Where a user chooses 'Black' from the first option then the images will only show a black shoe with white laces or brown laces (based on their choice from the next drop-down menu. Furthermore, where a user chooses 'Red' from the first option then image from the next choice will only show a red shoe with white or brown laces. So, this code does what it's supposed to do (check an array for dis-allowed input and supply the appropriate keyboard for touchscreen users) but I was worried that maybe this wasn't the most succinct logic... Code: kb=2,kp=1; for(var i in Setup.DisAllowed){ if(Setup.DisAllowed[i]==0) kp=0; if(Setup.DisAllowed[i]==1||Setup.DisAllowed[i]==2) kb--; } if(kp)APP.Module('KeyPad'); if(kb)APP.Module('KeyBoard'); if(kp&&kb)APP.Module('AlphaNumeric'); Keeping in mind the Setup.DisAllowed array and APP.Module method are fixed in stone, would anyone recommend a better way to use the array to select the necessary keyboard? Hi guys i am new to this forum facing some issues with my php code. The code below says on click go to cart.php I want to add a condition to the same-- if(reasons==Internal) { go to="cart1.php" } else { go to="cart.php" } Kindly help me with the same.... <td> <p align="center"> <input name="Next" type="button" id="Next" value="Next" onmouseover="reasonempty();"onclick='javascript:window.location.href="cart.php?form=tmrfForm&field=" +document.getElementById("reasons").value+"&field5="+document.getElementById("weekend").value,"","to p=0,left=400,width=1000,height=1000,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes,status=yes" ; return false;'> </p> </td> Will appreciate if pls put the code ....... new to JavaScript, simple question... question: how do i determine an output from a prompt to be bold? e.g. a user enters "hello" and the output printed from the prompt becomes bold one=parseFloat(prompt('enter number',0.bold)); Pretty pretty please help me with this I am running out of time and pulling my hair out with this whole thing. Thanks a million in advance! Rhonda <!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> function numberGuess() { stringVar=prompt("Enter your guess number"); while (stringVar<999) { } } </script> <script> function enterNames() { stringVar=prompt("Enter name"); } </script> <script> function enterProducts() { stringVar=prompt("Enter product name"); return } </script> </head> <body> <p> </p> <h1>WDV221 Intro Javascript</h1> <h3 align="center">Javascript Loops</h3> <p>Topics: loops, for loops, while loops, sentinels!</p> <p>Place all script code on this page.</p> <p>1. Create a function that will ask you for a number until you enter 999 which will end the loop. You do not need to display the number. </p> <p>2. Create a function that will ask you for a name until you tell the function that you do not have any more names. After you enter each name it will ask you if you have more names to enter. If you enter yes the process will continue. Display each name at the end of the following sentence.</p> <p>The name you entered is: </p> <p>3. Create a runtime script that will use a prompt( ) to accept how many products will be displayed. Use a for loop to display "Product Name" and the product number as a <p> element.</p> <p><strong>Example output:</strong></p> <p>Product Name 1</p> <p>Product Name 2</p> <p>...</p> <p>4. Create a runtime script that will use a nested for loop to create a table with 3 rows and 5 cells. Place the same number or a letter in each cell. </p> <p>Hint: Write a table in HTML. Do a row first then do multiple rows. </p> <p>5. Create a function called totalSales( ) that will ask the user to enter an amount until you enter "done". Add those amounts together and display them in an alert when the user is done entering amounts..</p> <p>Have fun!!</p> </body> </html> Hello. I want to display some text in some part of website when user "rolls over" an image. How can I make it possible? Text position must be totally flexible. (not over image) I am needing to use javascript to show a prompt, and when the user enters a number from 1-12 (1 for each month of the year) it adds it to a new array. Then when the user types "stop" it prints the corresponding months. I'm new to javascript so I am not quite sure how to go about doing it. This is what I have currently, but I don't think it is right. Code: <script type="text/javascript"> var month=['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; var selmonth= new Array(); var month2=prompt('Which Month', ''); if (month2==1){ selmonth[0] = month[1]; var month2=prompt('Which Month', ''); } if (month2==2){ selmonth[1] = month[2]; var month2=prompt('Which Month', ''); } if (month2==3){ selmonth[2] = month[3]; var month2=prompt('Which Month', ''); } if (month2==4){ selmonth[3] = month[4]; var month2=prompt('Which Month', ''); } if (month2==5){ selmonth[4] = month[5]; var month2=prompt('Which Month', ''); } if (month2==6){ selmonth[5] = month[6]; var month2=prompt('Which Month', ''); } if (month2==7){ selmonth[6] = month[7]; var month2=prompt('Which Month', ''); } if (month2==8){ selmonth[7] = month[8]; var month2=prompt('Which Month', ''); } if (month2==9){ selmonth[8] = month[9]; var month2=prompt('Which Month', ''); } if (month2==10){ selmonth[9] = month[10]; var month2=prompt('Which Month', ''); } if (month2==11){ selmonth[10] = month[11]; var month2=prompt('Which Month', ''); } if (month2==12){ selmonth[11] = month[12]; var month2=prompt('Which Month', ''); } if (month2=='stop'){ document.write(selmonth.join(" <br> ")); } else{ alert('Please enter a valid value'); } </script> It'd be great if someone is able to help me. Thanks. I have the following code to load iframes but I don't know how to make it load the "LT-video_default.html" when it first loads the page. If I choose one of the options and then go back and choose the "Choose a manufacturer" option it loads the desired page. Here is the code. Code: <script language="JavaScript"> <!-- Begin function leapto(form) { var myindex=form.dest.selectedIndex parent.CONTENT.location.href=(form.dest.options[myindex].value); // You can output to ANY frame using: parent.[framename].location.href } // End --> </script> <div id="videoWrapper"> <form name="labtv"> <select name="dest" size="1" onchange="leapto(this.form)"> <option selected="selected" value="LT-video_default.html">Choose A Manufacturer </option><option value="LT-video_nanodrop.html">NanoDrop </option><option value="LT-video_bioflux.html">Bioflux </option><option value="LT-video_genvault.html">GenVault </option><option value="LT-video_hamilton.html">Hamilton </option></select> </form> <iframe name="CONTENT" frameborder="no" height="400" scrolling="no" width="650"> </iframe> </div> I'm working very hard to create a dynamic web-site for use in the education sector using server-side php/MySQL and client-side HTML with javascript. I have a logon page (index.php) which looks to see if the cookie 'mylogon' is set with the value 'Again'. This cookie is set when the PHP element on the server detects an invalid username/password combination. If so I have a javascript function (see below) call from the HTML <body onload="check_invalid_user()"> I know that the function Get_Cookie is working ok and that the javascript variable 'again' has the value 'Again' in it and has a length of 5. The alert function is not executed though. function check_invalid_user() { again = Get_Cookie('mylogon'); // document.write(again); // document.write(again.length); If (again == 'Again') { alert("User-id and/or password incorrect -- Please re-enter"); } } ============= Any help would be appreciated Many thanks in advance. (Yeah you guessed it I'm new and raw to this stuff. A single letter is taken from each word in the sentence. Unlike before, either the first or last letter is taken. The letter taken is decided by which of the first or last is "greater" (e.g. "b" > "a", "c" > "b", etc.) Here are some examples based on the above rules: "hello" translates to "o" because "o" is greater than "h". "goodbye" translates to "g" because "g" is greater than "e". Full sentence example: "wazdee apple love bic nooo more end" This sentence will decrypt to "welcome". Complete the decryptB function so that it decrypts messages with the new scheme. Here are some examples: var decryptB = function(message) { // Your code here } var result1 = decryptB("wazdee apple love bic nooo more end") console.log(result1) // This should be "welcome" var result2 = decryptB("bria loud fuzu antidote") console.log(result2) // This should be "blue" Reply With Quote 01-20-2015, 09:41 PM #2 Old Pedant View Profile View Forum Posts Supreme Master coder! Join Date Feb 2009 Posts 28,310 Thanks 82 Thanked 4,754 Times in 4,716 Posts See the page http://www.codingforums.com/rules.htm See rule 1.5 We helped you way way too much the last time you asked the first variant of this homework problem. This is really a very simple variation on that. And you don't even include the final version of the code you used last time, so somebody who didn't see the last answers would have to start all over again. Not very friendly to potential responders. What have you *TRIED*? If you came running here without even trying to solve this, shame on you. At least show what you have tried and explain what results you get and, if you can, what you think is going wrong. By the way: How is the user supposed to output an "a" character? You need an answer to that question, methinks. How to create a popup blocker with javascript? I am looking for solution to open Enquiry form [Ex: send-query.php] through javascript linking. How can I do that? And how to display a popup blocker message like in the attached file? This is the url of my pop up image: http://www.rhapsody.com/thompson-squ...mpson-square-2 [When you click on play button then if you have popup blocker enabled you will get popup blocker message from the site] |