/    Sign up×
Community /Pin to ProfileBookmark

Add reset button without resetting certain fields

Hi There,

I would like to reset certain fields in the form without resetting all the fields either using JS function or reset button. Is there any information about this.

Thanks.
Indra.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@maroneyMar 11.2004 — Add a button which calls a javascript function:

<i>
</i>&lt;input type="Button" onClick="ClearFields()" /&gt;


Then in the javascript function do something like...

<i>
</i>function ClearFields()
{

document.getElementById('FirstField').value='';
document.getElementById('SecondField').value='';
}


...and so on
Copy linkTweet thisAlerts:
@indraauthorMar 11.2004 — Hi maroney

Thank you for help. Is there any way i can do this with action page.

I have a form and when user submit it will go to the action page.

I would like to say "click on the button to go back" when user click this button it go back to main form with those field with reset valules.

Thanks.
Copy linkTweet thisAlerts:
@indraauthorMar 11.2004 — HI There,

Its working fine if field name present only one time in the form. I have few field wthich are there more than one time.

Like field item with name="itemnumber" is there 6 time in my form. I can i reset same field which appear more than one time.


<input type="text" name="itemnumber">

<input type="text" name="itemnumber">

<input type="text" name="itemnumber">

<input type="text" name="itemnumber">

<input type="text" name="itemnumber">

<input type="text" name="itemnumber">

I want to reset "itemnumber" how can i do for this case.

Thanks.
×

Success!

Help @indra spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...