Author Topic: ContactLP Form Question  (Read 397 times)

0 Members and 1 Guest are viewing this topic.

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 490
    • Tyler Texas Weather
ContactLP Form Question
« on: January 11, 2022, 06:57:00 PM »
Ken,

I tried implementing the ContactLP Form today and was successful. However, I noticed that the "blocks" in the form do not align horizontally. It appears the blank "blocks" are aligned higher than the "blocks" containing numbers. When I look at the contact page at Saratog-Weather.org, I see the same thing with mis-aligned "blocks". However, when I look at the screenshots on the ContactLP Form page in your script section, all the blocks on a row appear to be level. Did something in the code change between the time you took the screenshots and the current iteration of the code?

Thanks,

Steve

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8621
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: ContactLP Form Question
« Reply #1 on: January 12, 2022, 12:02:12 PM »
Very odd.. it seems to be a browser-specific issue.

On Firefox, and SeaMonkey on Windows 10, it all looks like what is shown in the script page and the GitHub distribution (4 button rows.
On Chrome, Brave, Edge, Opera on Windows 10, it has the 4-button rows, but the 'empty' buttons are jogged up a bit compared to the buttons with numbers.

On an iPad or iPhone, Safari, Chrome, Firefox all show the two button-narrow column instead of the 4 button wide pad.

Looks like I need to do some CSS tweaking to have it look the same on all browsers.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 490
    • Tyler Texas Weather
Re: ContactLP Form Question
« Reply #2 on: January 12, 2022, 12:22:13 PM »
Hey Ken,

Glad to know it wasn't something I did wrong, but sorry to dump more work on your always-full plate.

Thanks very much.

Steve

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8621
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: ContactLP Form Question
« Reply #3 on: January 13, 2022, 01:19:36 PM »
Wow, that took a lot of exploring to fixup the CSS for the pad display so it looks mostly the same on all browsers.

V4.02 is now available, and the main change is to the CSS in contactLP.php/contactLP-inc.php.

Available on the script page or on GitHub distribution

I've tried it with Firefox, Google Chrome, Opera, Brave, SeaMonkey, Edge and IE11(yech!) on Windows 10, and on Safari on iPad/iPhone (iOS 15.2).  I don't have a working Mac to test with Safari on MacOS (sorry).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 490
    • Tyler Texas Weather
Re: ContactLP Form Question
« Reply #4 on: January 13, 2022, 05:32:00 PM »
Got the update installed and it looks much better. Thanks for your work.

Steve

Offline mexbound

  • Senior Member
  • **
  • Posts: 59
Re: ContactLP Form Question
« Reply #5 on: January 15, 2022, 09:09:28 AM »
One issue I found (not with the new update) in contactLP-inc.php, is in the function "validate_email". An email address that contains a "dash" would not validate even though it is a valid email address.  example: joe@joe-sam.com.   To get around it I just forced the $valid flag to 1 at the end of the function. I don't know enough about PHP to correctly fix the function to allow "dash".

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8621
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: ContactLP Form Question
« Reply #6 on: January 17, 2022, 07:12:17 PM »
I've done an update to contactLP-inc.php V4.03 to better handle those type of email addresses.  It now handles emails with - or . in the name or in the hostname.

Updated on the script page and the GitHub distribution

I tried a bunch of different regex mods, and this one seemed to be the best one in testing.  Here's the results on various email addresses:

Code: [Select]
Valid email: 'm-0-o.bfe-nfk@s-ugd-og.gg-gm-ain.com.pl'

Valid email: 'wfff-ef-ff.mi-ki.fi-ki.miki@dns1-su-ddd.o-ma.in.dom-ain.tech'

Valid email: 'max-io.be-nko@sub-dom-ain.dom-ain.com.tv'

Valid email: 'webmaster@some-weather.org'

NOT VALID email: 'Jean-François+@anydomain.museum'

Valid email: 'Jean-Francois+@anydomain.museum'

Valid email: 'joe@joe-sam.com'

The original regex had these results
Code: [Select]
Valid email: 'm-0-o.bfe-nfk@s-ugd-og.gg-gm-ain.com.pl'

Valid email: 'wfff-ef-ff.mi-ki.fi-ki.miki@dns1-su-ddd.o-ma.in.dom-ain.tech'

Valid email: 'max-io.be-nko@sub-dom-ain.dom-ain.com.tv'

Valid email: 'webmaster@some-weather.org'

NOT VALID email: 'Jean-François+@anydomain.museum'

NOT VALID email: 'Jean-Francois+@anydomain.museum'

Valid email: 'joe@joe-sam.com'

« Last Edit: January 17, 2022, 07:17:32 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline mexbound

  • Senior Member
  • **
  • Posts: 59
Re: ContactLP Form Question
« Reply #7 on: January 18, 2022, 08:36:03 AM »
Thanks for the update. Works perfect!