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,953 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,953
Overall visits to all the topics: 5,065,968
Daily average (Calculated from the website subscription day): 2,078.77
Optional sorting commands:
Normal order: click here
Order by amount of visits: click here
Current order: by category: Books
Other categories available for this author (Limited data report: 100):
Advice: Martial Arts and Self Defense(4), Books(236), Boxing(2), 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(13), Scientifical Reviews(4), Self Improvement(1), Sport Activities and Apparels(1), Tarots(1)
Showing topics: 1, 10
Available total: 450
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:
Maria Angelillo: I Mantra. Citazioni Preferite E Commento Identification Number: 451 Visitors: 7,434 Oscar Wilde: The Soul Of Man (Under Socialism): Part 2 Identification Number: 450 Visitors: 7,239 Oscar Wilde: The Soul Of Man (Under Socialism): Part 1 Identification Number: 449 Visitors: 6,621 Friedrich Schiller: Detached Reflections On Different Questions Of Aesthetics Identification Number: 448 Visitors: 7,233 Friedrich Schiller: Reflections On The Use Of The Vulgar Elements In Art Works Identification Number: 447 Visitors: 6,788 Friedrich Schiller: Of The Cause Of The Pleasure We Derive From Tragic Objects Identification Number: 446 Visitors: 5,899 Friedrich Schiller: On The Tragic Art Identification Number: 445 Visitors: 6,336 Rainer Maria Rilke: Lettere A Un Giovane Poeta. Citazioni Preferite In Italiano Identification Number: 441 Visitors: 8,650 Ananda K. Coomaraswamy: La Danza Di Siva: Citazioni Preferite In Italiano Identification Number: 439 Visitors: 7,252 Alberto Savinio: Maupassant E "L' Altro". Citazioni Preferite. Identification Number: 434 Visitors: 10,087
External services
This page of this subscriber uses external services: Hide