/    Sign up×
Community /Pin to ProfileBookmark

On change problem

Hello,

I like to get an other extra text field in my form when when 1 option is selected.
But the value of an option is not always the same.
I use php to get the date, increase it with one day every loop and display the name of the day with digit date.

Now I want to display an extra text field when Friday is selected

Can someone help me?

<?php
for ($d=0;$d<10;$d++){
$nu = date(“d-m-Y”,strtotime(“$d day”));
$day_of_the_week = date(‘l’, strtotime($nu));
if ($day_of_the_week == Monday){$day_of_the_week = ‘Maandag’;}else if
($day_of_the_week == Tuesday){$day_of_the_week = ‘Dinsdag’;}else if
($day_of_the_week == Wednesday){$day_of_the_week = ‘Woensdag’;}else if
($day_of_the_week == Thursday){$day_of_the_week = ‘Donderdag’;}else if
($day_of_the_week == Friday){$day_of_the_week = ‘Vrijdag’;}else if
($day_of_the_week == Saturday){$day_of_the_week = ‘Zaterdag’;}else if
($day_of_the_week == Sunday){$day_of_the_week = ‘Zondag’;}

echo ‘<option value=”‘.$nu.'”>’.$day_of_the_week .’ &emsp;’. $nu.'</option>’;
}
?>

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @gijsgans 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.19,
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,
)...