/    Sign up×
Community /Pin to ProfileBookmark

i cant made input type enable or disable. when i select drop down value then onpe input field enable and other disable[upl-image-preview url=https://www.webdeveloper.com/assets/files/2019-11-21/1574314807-616151-pblm.png]

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@VITSUSANov 21.2019 — Can you share your coding with us?
Copy linkTweet thisAlerts:
@ginerjmNov 21.2019 — Have no idea what this guy is asking.....
Copy linkTweet thisAlerts:
@NogDogNov 21.2019 — Sounds like a JavaScript issue?
Copy linkTweet thisAlerts:
@SempervivumNov 21.2019 — If I understand your intention correctly, this is not a server side issue. Check if this code does it:
<select id="select1">
<option>opt 1</option>
<option>opt 2</option>
<option>opt 3</option>
<option>opt 4</option>
<option>opt 5</option>
<option>opt 6</option>
</select>
<input id="input1">
<input id="input2">
<input id="input3">
<script>
var inp1 = document.getElementById('input1'),
inp2 = document.getElementById('input2'),
inp3 = document.getElementById('input3');
document.getElementById('select1').addEventListener('change', function () {
if (this.selectedIndex == 3) {
inp2.disabled = true;
inp3.disabled = false;
} else {
inp2.disabled = false;
inp3.disabled = true;
}
});
</script>
Copy linkTweet thisAlerts:
@hasib2020authorNov 23.2019 — @Sempervivum#1611066 Thanks a lot
×

Success!

Help @hasib2020 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 4.25,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

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