The Identification Number and Password fields need to be filled in. Moreover, you cannot send messages devoid of contents Adding further data is not allowed because this topic has been closed Print You provided no password: you have to write it in the textfield beside the command delete for the topic you want to delete Are you sure you want to delete this comment? You did not cast a vote. You need to cast a vote by selecting a radio button. Impossible to proceed Provide the project number Insufficient form parameters: you forgot to fill in some field/s
 
member picmember pic
 
Snippets of A
 
info Below you can find the text of the snippet you want to read, and the list of the other snippets by this author if available.
What are snippets?
Share on MySpace

Javascript Form Reset Elements Values By Elements Shared Name Plus Suffix

Snippet: Identification Number »   Snippet: Inclusion syntax »
Visitors: 8,702 Characters (in origin): 1,999 (pages: ~ 1)
Author: Em@il Permalink Cast your vote for this topic Printable version
OBJECTIVE: given a form with a set of elements sharing the same name prefix followed by a progressive number, reset their values.  
A simple task - a similar task is Javascript Form Clear Default Input Values Upon Submit.
function resetValuesByName(form, namePrefix, start, newValue){
if(typeof namePrefix!='string'){namePrefix='';}; start=Math.abs(start)||0; newValue=newValue||'';
for(var i=start; form[namePrefix+i]; i++){form[namePrefix+i].value=newValue;}
return false;
}
Remove colors  
 
INPUTS: first the form object such as, for instance, it would be retrieved via document.getElementById  
Then a string representing the shared prefix name of all the form fields whose values must be reset.  
Then an optional number, defaulting to zero, representing the starting number to append to the previous argument, and to increment by one unit at each iteration, in order to locate the form elements.  
Then an optional string, defaulting to an empty string, which is the new value to assign.  
 
RETURNS: boolean false  
 
CAVEATS: the function uses the associative nature of every form, that holds as its properties its elements by element names.  
Of course, if the numerical progression of the suffix is broken (that is, a prefix name followed by 1,2,3 and then, say, suddenly jumping to prefix followed by 5 instead than by 4) the function would halt.  
 
Example of use:
<script>
//include your function here, then:
</script>

<form id="foo">Fill in, then click the reset link:<br />
<input type="text" name="a_name_prefix1" /><br />
<input type="text" name="a_name_prefix2" /><br />
<input type="text" name="other_name" /><br />
<input type="text" name="a_name_prefix3" /><br />
</form><br />
<a href="#" onclick="return resetValuesByName( document.getElementById('foo'), 'a_name_prefix', 1 )">reset</a>
Remove colors
Printable version To exclude hyperlinks from the print, check the checkbox »
Rss

Cast your vote for this topic

To perform this operation it is not necessary to be Full Poster members.
«Negative Positive»
Click here to save your vote (Current average: 0.00, Voters: 0)
Are you the author of this topic and do you want to append quickly more text? click here
Other topics
This subscriber has a blog too: Read the blog: 57 Shoutbox: 103 reviews: 153
Visitors: 8,702
Overall visits to all the topics: 4,952,220
Daily average (Calculated from the website subscription day): 2,058.28
Optional sorting commands:
Normal order: click here
Order by amount of visits: click here
Current order: normal
Other categories available for this author (Limited data report: 100):
Advice: Martial Arts and Self Defense(4), Books(236), Critical Reviews and Essays(4), Dictionaries(1), Emergency Care(4), Epistles Letters and Advice(5), Fantasy Epics and Fables(1), History and Documents(5), Humor and Jokes(2), Methematics(2), Music and Lyrics(6), News Digests and Press Reviews(1), Novels Poetry and Stories(3), Philosophy Reviews(7), Poetry(1), Programming(4), Programming Ajax(2), Programming Javascript(82), Programming Php(52), Psychology(1), Quotes(1), Religion Esoterica and Spirituality(12), Scientifical Reviews(4), Self Improvement(1), Sport Activities and Apparels(2), Tarots(1)
Showing topics: 1, 10
Available total: 448
View only a list of the snippets by this author: click here.
Other topics available for this author: click on any title below to view the complete item:
Fighting Competently: Anticipation, And Remember It's In His Eyes Identification Number: 465 Visitors: 243 La Musa Segreta: Superiorità Onnipervasiva Della Boxe Identification Number: 464 Visitors: 1,176 Ha Senso Il Doping Sportivo? Effetto Matteo Nello Sport E Business Sportivo Identification Number: 463 Visitors: 1,404 The Musicians Within The Music Box And Other Hereafter Stories Identification Number: 462 Visitors: 2,664 Freud And Jung In A Nutshell: Three Or So Shots At Psychoanalysis For Dummies Identification Number: 461 Visitors: 4,124 Division The Math Of Gods: Ambiguities Of Antanairesis And New Math Operations Identification Number: 460 Visitors: 4,325 The Meaning Of Cruelty Identification Number: 459 Visitors: 4,759 Dÿanèra Ad Eleusi: La Folgorazione Ontologica: Il Pensare Sistematico E Non Identification Number: 458 Visitors: 5,578 Creative Writing: How To Write A Novel. Best Tips From The Bester Professionals Identification Number: 457 Visitors: 7,383 Newsreel Pseudo Intel: The Middle East Approaching The New 20s Identification Number: 456 Visitors: 7,351
External services
This page of this subscriber uses external services: Hide