close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Form Issue

Thread began 8/12/2022 5:52 am by yogastudents362523 | Last modified 8/13/2022 8:51 am by yogastudents362523 | 40 views | 4 replies

yogastudents362523

Form Issue

Hello,

I apologise, but I do not know Javascript, and so am uncertain how to incorporate the underneath into a form.

I have a lot of Presenters from all around the world, and need them to indicate to me what timezone they reside in.

I found a little bit of javascript code that neatly creates an array of timezones. This can then create an input box in the obvious way. My presenters can then select the one applicable to them.

However, I am uncertain how to send the value they have selected across to the update query, when they push the "Update" button.

I am sure that, as ever, it is quite elementary.
Thank you for your kindness.

Here is the coding I have thus far

<form name="mytimezoner" method="post" action="">

<?php
$regions = array(
'America' => DateTimeZone::AMERICA,
'Pacific' => DateTimeZone::PACIFIC,
'Europe' => DateTimeZone::EUROPE,
'Australia' => DateTimeZone::AUSTRALIA,
'Asia' => DateTimeZone::ASIA,
'Indian' => DateTimeZone::INDIAN,
'Africa' => DateTimeZone::AFRICA,
'Atlantic' => DateTimeZone::ATLANTIC,
'Antarctica' => DateTimeZone::ANTARCTICA
);

$timezones = array();
foreach ($regions as $name => $mask)
{
$zones = DateTimeZone::listIdentifiers($mask);
foreach($zones as $timezone)
{
// Get current time
$time = new DateTime(NULL, new DateTimeZone($timezone));

// Change from military time
$ampm = $time->format('H') > 12 ? ' ('. $time->format('g:i a'). ')' : '';

// Remove region name and add a sample time
$timezones[$name][$timezone] = substr($timezone, strlen($name) + 1) . ' - ' . $time->format('H:i') . $ampm;
}
}


// Create Viewable Selections


print '<label>Select Your Timezone</label><select name = "timezone" id="timezone">';
foreach($timezones as $region => $list)
{
print '<optgroup label="' . $region . '">' . "\n";
foreach($list as $timezone => $name)
{
// print '<option name="' . $timezone . '">' . $name . '</option>' . "\n";
print '<option value="' . $timezone . '">' . $name . '</option>' . "\n";
}
print '<optgroup>' . "\n";
}
print '</select>';
?>

<input type="submit" name="Update" class="button fit primary" value="Press to Save and Update">
</form>

I am simply uncertain what to put in the fields DataAssist kindly provides for me as a part of its convenient Update query.

Thank you.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...