Mintoris
Feb 23, 2018, 11:28 PM *
Welcome, Guest.

login

register

Did you miss your activation email?


Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: HTML Form date input  (Read 268 times)
wills
Full Member
***
Posts: 34


« on: Dec 18, 2017, 03:23 PM »

Not to post again so soon but while I'm reworking my program I've notice the date input in not pulling up the native date picker in android.  The date picker is all dark theme with the text and selected date not showing.  I am using  <p>Date Purchased: <input type='date' name='dpurchased'/></p>.  My phone is a Samsung so it could be a phone issue as well.  This is a sample of what I'm doing.
It loads correctly in the phones HTML viewer.
I've added screen captures the first is from Mintoris, the second is from my phones html viewer.

Orientation 1
ct = Time()
ct$ =  FormatTime$(ct,"yyyy-MM-dd")
'
'
form$ = "<html>"
form$ = form$ + "<head >"
' form$ = form$ + "<meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\"/>"
' form$ = form$ + "<link rel=\"stylesheet\" type=\"text/css\" href=\"html/contacts.css\"/>"
form$ = form$ + "<title >Edit Shares</title>"
form$ = form$ + "<style> body{background-color:black;}"
form$ = form$ + "h2 {color:white;}"
form$ = form$ + "p{color:white;}"
form$ = form$ + "</style>"
form$ = form$ + "</head>"
' form$ = form$ + "<body bgcolor=\"White\">"
form$ = form$ + "<div align=\"center\">"
form$ = form$ +  "<h2>Edit Shares</h2><hr>"
form$ = form$ + "<form id='enter' method='GET' action='ENTER'>"
form$ = form$ + "<p>Symbol: <input type='text' name='symbol'/></p>"
form$ = form$ + "<p>Shares: <input type='number' name='shares' value='0' style='margin-left:5px'/></p>"
form$ = form$ + "<p>Cost:   <input type='number' name='cost' value='0' style='margin-left:22px'/></p>"
form$ = form$ + "<p>Date Purchased: <input type='date' name='dpurchased'/></p>"
form$ = form$ + "<p>Select Date to Use:<br /><input type='radio' name='source' value='yahoo' checked /> Yahoo's Date "
form$ = form$ + "<input type='radio' name='source' value='mandate' > User's Date </p>"
form$ = form$ + "<hr><br>"
form$ = form$ +   "<input type='submit' name='submit' value='Save'style='margin-right:30px'/>"
form$ = form$ +   "<button type='button' name='cancel' value='true'>Cancel</button>"
form$ = form$ + "</form>"
form$ = form$ + "</div>"
'
form$ = form$ + "</body>"
form$ = form$ + "</html>"
HtmlBrowser On
HtmlLoadData form$


print form$

« Last Edit: Dec 21, 2017, 06:10 AM by wills » Logged
wills
Full Member
***
Posts: 34


« Reply #1 on: Jan 30, 2018, 05:48 PM »

Till I get a html datepicker working I have written this date picker in Mintoris.  It is just a loop for demonstration but can easily be modified to handle larger date ranges.  It does check for leap year to avoid Feb 29, 2016.
Logged
Chuck
Global Moderator
Hero Member
*****
Posts: 1871



« Reply #2 on: Jan 31, 2018, 12:21 AM »

Oh, I think if you write form$ to a html/tmpfile.html and then use the HtmlLoadFile command instead of HtmlLoadData, it will work. That is how the Contact Database demo program is written.

Don't forget to uncomment this statement.

' form$ = form$ + "<link rel=\"stylesheet\" type=\"text/css\" href=\"html/contacts.css\"/>"

If you use a css file then you have to use HtmlLoadFile for it to find the css file. I think that the folder path HtmlLoadData is the system default and not the Data folder.

The difference may be that the html browser app has a better default css than the html viewer window provided to developers. If you don't explicitly specify your own css, then you are at the whim of the browser you are using. No two browsers may show the same colors.
« Last Edit: Jan 31, 2018, 12:32 AM by Chuck » Logged
wills
Full Member
***
Posts: 34


« Reply #3 on: Jan 31, 2018, 06:07 AM »

Chuck l have gone so far as to make a separate html file and load it.  The html displays but not in the light theme to where all fields and selections can be seen.  I believe it may be the phone.  I'm using an S8+ now and when I wrote the program I was using an S5 and it displayed correctly then.  I rewrote my edit shares input screen in the graphics mode and with my new date picker and input commands and it  works fine.  That's what I like about Mintoris there is always more than one way to do things.  I should make them subs to save space.  Thanks for the help.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.027 seconds with 17 queries.