/    Sign up×
Community /Pin to ProfileBookmark

Accessing fields disabled by Javascript

I have a form where a customer can enter payment information. I present some different payment choices, and the customer must choose via selecting a radio button. Selecting radio button 1 reqiires the customer to enter some data. Let’s say they filled in a few fields, but then select a second radio button to indicate they want to pay in a different manner. I fire off some Javascript to disable all of the fields associated with radio button 1. Now when the form is submitted I’d like to capture the data from the disabled fields, but since they are disabled, it seems they are not available via Request.Form(“Field1”). What can I do to solve this problem?

Thanks,

BB

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@J2NYCMar 25.2009 — Try creating an "On Submit" function that enables the disabled fields.
Copy linkTweet thisAlerts:
@KorMar 25.2009 — Could be something like:
<i>
</i>&lt;form action="" onsubmit="var i=0, e;while(e=this.elements[i++]){e.disabled=false}"&gt;
Copy linkTweet thisAlerts:
@felgallMar 25.2009 — Why not make the fields readonly rather than disabling them.

Both readonly and disabled fields are not able to be update by the person filling out the form but readonly fields are sent with the form whereas disabled fields are not.
×

Success!

Help @BrianBurgit 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...