Web Connection
Example of WebConnect form date picker
Gravatar is a globally recognized avatar based on your email address. Example of WebConnect form date picker
  Michael Hogan (Ideate Hosting)
  All
  Oct 18, 2025 @ 01:00pm

I'm unclear about how to grab the content of the form date. The following shows the control quite well on the form, but the date is not being collected:

In FoxPro, I'm trying to grab the value like this: Request.Form('Mtg_St_D8')

The variable TYPE appears to be numeric, [ WAIT WINDOW TYPE(Request.Form('Mtg_St_D8')) = N ] but [ WAIT WINDOW Request.Form('Mtg_St_D8') ] returns the value as a date. My destination table field is type DATE()

On the HTML edit form, the form field is like this:

        <div class="form-group form-horizontal">
            <label class="col-sm-2">Meeting Date:</label>
            <div class="col-sm-7">
                <input name="Mtg_St_d8" type="date"
                    value="<%= Request.FormDate('Mtg_St_D8',poEvent.Mtg_St_d8) %>"
                    class="form-control"
                    placeholder="(Optional)" />
                <%= HtmlBindingError("Mtg_St_d8",poError.Errors) %>
            </div>
        </div>

What am I missing?

TIA

Gravatar is a globally recognized avatar based on your email address. re: Example of WebConnect form date picker
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Oct 18, 2025 @ 06:55pm

Not sure what you're doing exactly.

Take a look at the bottom example of the the Date examples in the Web Connection samples:

<div class="form-group">
    <label for="ptDate5" class="control-label">Date Only:</label>
    <input id="ptDate5_field" name="ptDate5" type='date' class="form-control"
           value="<%= ToIsoDateString( Request.FormDateOrValue('ptDate5',ptDate5) ) %>" />
    <i><%= ptDate5 %></i>
</div>

<div class="form-group">
    <label for="ptDate6" class="control-label">Date and Time:</label>
    <input id="ptDate6_field" name="ptDate6" type='datetime-local' class="form-control"
           value="<%= ToIsoDateString( Request.FormDateOrValue('ptDate6',ptDate4),.T.,.T.) %>" />


    <i><%= ptDate6 %></i>
</div>

Then to retrieve:

ptDate5 = Request.FormDateOrValue("ptDate6",DateTime() - 7400)
ptDate6 = Request.FormDateOrValue("ptDate6",DateTime() - 7400)

Native date controls suck in that they don't return dates directly and use UTC formatted time that has to be adjusted. The functions adjust for this. It's awkward as heck.

Gravatar is a globally recognized avatar based on your email address. re: Example of WebConnect form date picker
  Michael Hogan (Ideate Hosting)
  Michael Hogan (Ideate Hosting)
  Oct 20, 2025 @ 07:53am

Excellent - thanks!

© 1996-2025