Editing Code By Adding Random Selection?
Nov 4, 2008
I am trying to figure out how to make an online quiz via Javascript, based on just a couple questions (4 to be exact) from a question-bank, and I want only 2 of the questions out of the 4 to appear when the quiz is taken (randomly of course).I found a great template online for what I want my quiz to look like, however, it does NOT have the random add-on functionality I would like.I am not looking for the 'answer' or for someone else to do the workHere is the quiz template I found:
<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 StrictEN"
"http:www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
[code]....
View 3 Replies
ADVERTISEMENT
Oct 1, 2009
I am trying to edit some script to have the photos rotate randomly rather than rotate in order. (The first half of the script was generated by dreamweaver)((Also, this is not my own code to begin with))
function MM_preloadImages()
{ //v3.0[code].....
View 1 Replies
View Related
Aug 4, 2011
I am really new to javascript, and what I try to learn I can't seem to retain. Anyway, I have some text that onclick will allow anyone to edit it. I was recently told that this field should only be editable for admins. I don't know anything about the code or the website because it just became my project a couple weeks ago.
View 1 Replies
View Related
Apr 18, 2011
For my website I would like to create a famous last words generator (randomized), and random page generator (within my site). What is the code for random quotes and random links?
View 2 Replies
View Related
Feb 7, 2011
I need to know level of difficulty/hours needed to do this:
A user uploads a photo into an editing tool. It takes a couple of seconds to upload the full res version. Then, when the photos are being edited in the tool (cropping, color, etc.) it converts to low res for faster editing, so the high res image doesn't have to load every time there's a change. Once the user is done, and/or adds their final product, the manipulated image is saved to hi res again, for print.
What is the time estimate/level of complexity if this? The code is there for the tool (some advanced JavaScript), just need to change the speed of editing. Server disk write speed is plenty fast.
View 2 Replies
View Related
Jan 11, 2010
I am trying to take the values of 2 or more select boxes, add them together and then update a text field each time a selection in one of the select boxes is made. Basically, I am trying to keep a running total.
Currently I have it set up so that onchange it grabs the selected value. The problem is that it is being processed as a string I believe. For instance, if there are two variables, a=111 and b=222, the output in the text field reads 111222. I tried using parseInt, but that just returns NaN (not a number?...just a guess).
I have seen this solved with if statements, grabbing the selected index # and then assigning an integer, but I am hoping there is an easier way.
View 12 Replies
View Related
Oct 19, 2009
I would like to create a Blackjack style game for one of my high school programming classes. I can generate 3 different random numbers and use these random numbers to display an image with that number on it.
How do I add the 3 separately generated numbers together to show the total??
Here is my code so far. Specifically I would like to add the myNumber1(), myNumber2() and myNumber3() results together.
<html>
<head>
<title>Play 21</title>
<script language="javascript">
function myNumber1(){
[Code]....
View 2 Replies
View Related
Jul 16, 2011
On my website, I have random logos appear on the home page as products that I recommend. I would like to make these logos into links to the website they are from, so that when one clicks on the picture, it directs you to the site, but I can't quite get it to work, and I know very little about Javascript (as you may know from my previous question about Javascript).
Here's my current JS code:
<!--
// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
[Code].....
View 6 Replies
View Related
May 29, 2009
I have a pretty basic HTML form, it doesn't go to a database or anything, it just gets emailed directly to the owner of the website with their customer query.However, the owner has now asked that each query be assigned a random reference number of no more than 16 digits which must also be visible to the customer.I presume this will be relatively easy but I'm a complete beginner with Javascript which I assumed would be necessary for generating the number. I've sort of figured out how to generate the number but I can't figure out how to get that number into a read-only field on the form so that it will be both visible to the client and sent with the rest of the data on the form to the owner.I've had a number of attempts but this is what I'm trying at the moment:
Code:
<html>
<head>
[code]....
View 2 Replies
View Related
Jul 20, 2005
I am trying to do is have:
1.) the background color to change randomly with 5 different colors.(change
on page load)
2,) 10 different quotes randomly fadeing in and out in random spots on the
webpage. with a delay timer on them, so they keep changing as the page is
open. Not random each time the page is loaded.
View 10 Replies
View Related
Aug 17, 2010
This little snippet of code produces random quotes but sometimes gives a missing quote between two quote marks.
<HTML>
<HEAD>
<TITLE>Javascript - RANDOM QUOTES</TITLE>
<script type="text/javascript">
[code].....
I use around 50 quotes in the real thing.
View 4 Replies
View Related
Apr 28, 2006
I have this script here that displays each ticker in a linear fashion. I would like to generate it so it will output my products randomly. For example, instead of: product1, product2, product3 etc.. I would like: product3, product1, product2. Does anyone know how to do this with this code? Code:
View 1 Replies
View Related
Nov 13, 2000
I was wondering if anyone could help me with the javascript code that inserts a random number into the banner code. I had an example a month ago that worked, I stopped using it for a while, and now the forum I had gotten it from has deleted that post. I've tried to take other examples and make my own, but the banner doesn't display correctly. I'm not sure what I'm doing! Code:
View 4 Replies
View Related
Feb 15, 2012
I need to get the selection position by js and make sure that this code work for all the browsers.
For example, the user selected this text (red text is selected):
Hello world
The function should return to me array or two values wich they are: 3,9 (start and end position of the selection)
View 2 Replies
View Related
Oct 28, 2011
I am trying to create a javascript code in which I prompt the user for a number (an integer from 0 to 100) to search for, then search a function with the number they entered and then display whether the number was found, and if found, a location where it can be found within the list.
<html>
<head>
</head>
<body>
[Code]....
View 4 Replies
View Related
Aug 9, 2011
Basically, I have it so that when you click something, then it expands and then shows text. The part I am having trouble at is the text being a php include. Here is the line that works for pre-typed in information:
divbody.innerHTML = "Some random text here.";
Then when I want to do something like this:
divbody.innerHTML = "<?php include('widgets/products.php'); ?>";
Then the actual innerHTML comes out like this:
<!--?php include('widgets/products.php'); ?-->
It seems as if it is changing '<' and '>' to '<!--' and '-->' respectively.
View 3 Replies
View Related
Oct 25, 2005
I've site that is divided into two frames
Frame 1 Frame 2
???????????????????????
? ? ?
? ? ?
???????????????????????
At the first frame reside my site content.
At the second frame I'm hosting other (random) site from the net.
the question is:
How do I ** add ** code into the other site html document in order to add it
functionality that I need?
View 6 Replies
View Related
Aug 5, 2009
<script type="text/javascript" language="javascript">
function toggle()
{
var ele = document.getElementById("toggle");
[Code]....
The above toggle code works perfectly.
How can I edit the code to use buttons instead of text? In other words: How can I replace two different texts that say "Show" and "Hide" with two different buttons that say "Show" and "Hide"?
View 1 Replies
View Related
Nov 3, 2010
I was wondering if it is possible to add js logging onto a webpage and have this writing out to a separate file with the details?
I have a page which is only showing the header and not the rest of the page, I want to add loggin code to find out where it is breaking.
how would I go about setting it up?
View 3 Replies
View Related
Jul 17, 2011
My name is juan and recently started html programming. I have a web page with a drop box with the name of states.
Code:
<option value="">Alabama</option>
<option value="">Alaska</option>
I can add a onclick="code here" to the tag so that when the drop box alabama is selected it triggers the onclick event. Im using Ibox in order to have a image of the state open.
Code:
<a href="images/large/image_1b.jpg" rel="ibox" title="alabama at 1024x450!"><img
src="images/small/image_1.jpg" alt=""/></a>
the above is a <a> link tag correct? How do I go bout adding the above code into the onclick event?
View 2 Replies
View Related
Apr 26, 2010
I tried to create a function to reduce some in line code. However something is wrong with the function call getGenderChoice() because the code stops working. If I comment out getGenderChoice() and uncomment the lines that would be in the function it works properly. What would possibly be wrong with a function call that seems to follow function rules?
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Main</title>
[Code].....
View 3 Replies
View Related
Feb 16, 2010
What I Need:An auto-suggest feature(1) so that when a person types in an address and presses go it automatically brings down a menu to show a list of relevant addresses (for example someone types romford road, it will bring down the different "romford roads" that it can find), upon clicking the desired "romford road" it is then automatically marked on the map.
How will it be used?Im using Google maps(2) with a FROM and TO text boxes, that when valid postcode/road names etc are typed in, it calculates the price based on distance. Adding an autosuggest will speed up the process.
(1) [URL]... This is the page I am currently using, when the customer fills in and presses calculate price, the price is shown along with the route plotted on the map. The calculate price button is then hidden and a "click here to book" is made visble which then passes on the various variables to a booking page.
(2)[URL]... The autosuggest feature on this page is EXACTLY what I need although I have no idea how to merge it with my one
View 2 Replies
View Related
Aug 7, 2009
I have a function to accept number and certain text only when "Enter" key is pressed.
function handleEnter(field, event){
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
var tmp_val = "";
[Code]....
However, when I added a second condition, the code stops working if (isNaN(tmp_val) && (tmp_val!="ABC" ||tmp_val!="DEF") )
View 4 Replies
View Related
Nov 27, 2011
i have two images which are part of a rollover button that i want to have paused until the intro animation finishes. I have the javascript code but the rollover images are specified in the css. I just have the id to them in the html. I was wondering if anyone knew how to include the rollover files with the pausing javascript code. the files are profile.gif and profileover.gif. I tried to add the files to the preload part of the javascript but that didn't work.
View 2 Replies
View Related
Nov 26, 2011
i have two images which are part of a rollover button that i want to have paused until the intro animation finishes. I have the javascript code but the rollover images are specified in the css. I just have the id to them in the html. I was wondering if anyone knew how to include the rollover files with the pausing javascript code. the files are profile.gif and profileover.gif. I tried to add the files to the preload part of the javascript but that didn't work. The website is [URL]...
View 8 Replies
View Related
Feb 7, 2011
I need US zip code formatting on my page. As zip code can be 5 digits or 5-4 digits, our requirement is that when user types in 6th digit, hyphen automatically gets added between 5th and 6th digit. Ex: user enters 100161, it should become formatted as 10016-1 and then user can continue to add rest of digits.
View 1 Replies
View Related