I have create a spinnrer (numeric up and down field) in my form. Below is the code for it:
Code:
<form action="create_session.php" method="post" name="createsession"> <!-- This will post the form to its own page"-->
<table cellpadding="0" cellspacing="0" border="0">
<tr>[code]............
Now what my question is how can I get the spinner to only allow numbers to be inputted in the spinner and not letters. Also how can I get it to only allow 2 digits to be entered in the spinner?. I know it will require an if statement but I don't know how to do it.
Question 1: I have a spinner function and I have one slight problem with it. If a user types in 00000009 or 00021 in the spinner for example, if the user clicks away from the spinner, it will still display 00000009 or 00021 in the spinner. What I want is that if something like this happens, then what I want is that when the user clicks away, I want the spinner to display it as 9 or 21 rather than 00000009 or 00021. I don't know how to do this though. Does anyone know how to overcome this:
Question 2: If I used backspace to remove a number from a spinner and that is left with a blank spinner, what needs to be done so that if I click away from the spinner, the last number in the spinner re-appears in the spinner?
I have 2 questions about my spinner. first question is that if a number is removed in the spinner by backspace and that there is no number in a spinner, when I click away from the spinner, it shows an empty spinner. What I really want is that if the spinner is empty and I click away, I want the spinner to display 0 instead. How can this be done?
second question is that if I enter in 00045 or 0000009 in a spinner and I click away, I want it to display 45 and 9 and not 00045 and 0000009. How can this be done as well?
I am trying to show and hide a div which contains a animated "spinner.gif" file. Is there any way to toggle a div from block to none without using an onEventHandler?My toggle script is as follows:
Code: <script type="text/javascript"> function toggle(x) { if (document.getElementById(x).style.display == 'none') {[code]........
What I would like to ultimately have happen is be able to put this toggle code into an External JS file which will validate a form I am filling out. The process with go something like...
1. Submit Form
2. Validate form
2a. Load hidden div containing spinner animated gif
2b. Pause validation script for 3 seconds so the animated gif gets a change to display to the user that a process is working
2c. Pause ends and the external javascript file continues processing
3. Hand off form values to php and from my php file use the toggle function to finally hide the spinner div after the results have loaded on the page.Is it possible to toggle on and off a div without the event handlers?
I have a simple asp page that pulls info out of a db, but ita takes a while to load and display.Can I put a spinner say onload and then it stops when my page is finished and displayed??
I am developing an web application where i've embed a flash file in a web page. I want that until that flash file is being loaded in that page a spinner should be displayed. So that user may think that the file is being loaded and doesn't leave the page. How can I achive it through Javascript?
Since the code is triggered ever onclick event it may be resource hungry on large pages.
I guess desired upgrades to suit it more for general purpose and reuse would be:
1> Replace document.write with a way of altering the CSS class rule property. Hard part on this after reading quirksmode would be in targeting the CSS rule in a cross browser, not to intensive way.
2> Find a better cross browser trigger attachment than the current firing on every click.
<!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>Spinner Test</title> <style type="text/css"> <!-- .spinnerContainer {} .spinnerLink {cursor: pointer;} .spinnerContent {display: block;} --> </style> <script language="JavaScript" type="text/JavaScript"> document.onclick=function(evt){ //Credit to Beagle and coding forums http://www.codingforums.com/showthread.php?t=90062 if(!evt){evt=window.event;} // *** IE fix *** var spinner;// *** element that got clicked *** // *** Credit to PPK from quirksmode.org for this block *** if(evt.target){spinner=evt.target;} else if(evt.srcElement){spinner=evt.srcElement;} if(spinner.nodeType==3){spinner=spinner.parentNode;} // defeat Safari bug if(spinner.className=='spinnerLink'){ var contentDiv=spinner.nextSibling; if(contentDiv.nodeType==3){contentDiv=contentDiv.nextSibling;} //Action if(contentDiv.style.display!='block'){contentDiv.style.display='block'}else{contentDiv.style.displa y='none'} }//from: if(spinner.className=='spinnerLink'){ }//from: document.onclick=function(evt){
I have a select menu that look like this: HTML Code: <select name="zoom"> <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> <option value='6'>6</option> <option value='7'>7</option> <option value='8'>8</option> <option value='9'>9</option> <option value='10' selected>10</option> <option value='11'>11</option> <option value='12'>12</option> <option value='13'>13</option> <option value='14'>14</option> <option value='15'>15</option> <option value='16'>16</option> <option value='17'>17</option> <option value='18'>18</option> <option value='19'>19</option> <option value='20'>20</option> <option value='21'>21</option> <option value='22'>22</option> <option value='23'>23</option> </select>
And I need to make it display with a "spinner" so that it has little up/down arrows (as if the height of the select menu was 2, but without showing 2 numbers at a time)... At the same time, however, I need them to not be able to go above 23 or below 1...
I like to try to do some jquery and spinner then load some html code into a div content. I'm not looking deep into the coding part of jquery yet but here's my question. What will be the a href tag look like?
Do you put the url on href or attr? Can I still put the url on href? The reason I ask it's because seo friendly? Will search engine look into other pages by href? But I guess this way will actually load the whole page in the browser and there's no way I can do ajax stuff in this format? I like to do something nice on my links but don't want to hurt the seo part.
I have been practicing using canvas to make designs. My current code below will load the word the user inputs and makes it bounce around the canvas as well as a text spinner. However, whenever the user inputs a second word, the bounce below stops to start a new one and the text spinner messes up. so when the user inputs another word, that it either reloads a new textspinner or adds another one, as well as just add the word to the canvas without stopped the old one.
This should probably be pretty basic and I've been googling around as to the best approach to take and still a bit confused. I have a form that currently submits a form to a new window using jquery (shown below.) The form once submitted could go through a few redirects within the new window (it's calling some facebook stuff.)
All I'd like is when the initial new window pops up is for a spinner to appear in the popup window until the first response is returned. Is there a decent example on how to do best achieve this?
This does what I want; without the operator 'Number' I get a concatination of the various variables (as expected). Is there some way of globally defining all variables as numbers instead of strings?
How do I find the row & column number of the table for a checkbox on its Onclick event
The following HTML sample works perfect in IE. On click of the checkboxes, I am displaying the row number and its column number. How do I manage the same in Firefox? Code:
iwant to ask on how to display the sum of the 20 numbers i allready get the everage but i want to display the sum together of the everage this my code..
I am tring to sort some six numbers..the problem is that it doesnt work when I use "document.getElementById" instead of "document.write() my program is supposed to write six numbers every second..line by line Could you get it work ?
How can you join two numbers together in javascript, like you would join two strings?For example, if you have two variables, with 1 stored in each, how can I join them together, so I get 11, instead of 2?
Another quick question. I have the script to add each field up I need, but if the ending 0 after a decimal is present it doesnt show. How do I keep the leading zero and how do I keep just 2 digits after the decimal?
For example:
1 + 1.50 = 2.50
But javascript displays it as 2.5
Now sometimes when I do math I get:
2.3454545
In this case I just want 2.34. So if there is a ending zero I want to keep it, and if there is more than 2 numbers after the decimal I want to cut the rest off and leave the 2 there.
iw ant to have a function so that user can only enter numbers in the text box and + ( only once in the beggininging). if user wants to add + he can only enter + once as the first character like +123 or 123 bt cannot enter 1+2 or 123+ or +123+