Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #39363 > unrolled thread

Re: Form processing issue

Started by"Michael Haufe (TNO)" <tno@thenewobjective.com>
First post2021-01-15 12:53 -0800
Last post2021-01-16 00:44 +0100
Articles 2 — 2 participants

Back to article view | Back to comp.lang.javascript

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Form processing issue "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-01-15 12:53 -0800
    Re: Form processing issue Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-01-16 00:44 +0100

#39363 — Re: Form processing issue

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2021-01-15 12:53 -0800
SubjectRe: Form processing issue
Message-ID<c482e5e4-1e58-4f1b-a9d5-78e347353b82n@googlegroups.com>
On Friday, January 15, 2021 at 11:57:35 AM UTC-6, The Doctor wrote:
> Got this form doing 
> a calculation as follows: 
>
> [...]
> 
> WE are trying to add in fractional stuuf 
> 
> put the fraction in this case is 
> coming out as 52.5.00 when it is suppose to pass 
> 52.50 ? 
> 
> Given the above , how do I fix this? 

TL/DR. Can you make this more succinct?

The mixing of PHP and JavaScript makes this painful to look through.

Have you considered simply generating JSON from the server for the client to use? 

Something like:

```
<?php
...

$jsonData = ...

...generate $jsonData
...
?>

...
<body>
    <input type="hidden" id="serverData" value="<?=$jsonData?>">
    ...
</body>
```

[toc] | [next] | [standalone]


#39365

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2021-01-16 00:44 +0100
Message-ID<12686446.uLZWGnKmhe@PointedEars.de>
In reply to#39363
Michael Haufe (TNO) wrote:

> On Friday, January 15, 2021 at 11:57:35 AM UTC-6, The Doctor wrote:
>> Got this form doing
>> a calculation as follows:
>>
>> [...]
>> 
>> WE are trying to add in fractional stuuf
>> 
>> put the fraction in this case is
>> coming out as 52.5.00 when it is suppose to pass
>> 52.50 ?
>> 
>> Given the above , how do I fix this?
> 
> TL/DR. Can you make this more succinct?
> 
> The mixing of PHP and JavaScript makes this painful to look through.

You can view it in/copy it to your favorite editor for syntax highlighting.
But I keep thinking that syntax highlighting in a newsreader would be really 
helpful.

Having had a quick look at the code, I have to say that they are doing 
virtually ALL things in the worst possible way (probably amateurs, but 
still).  Some highlights:

- all PHP code (not just template code, which can be forgiven) in the
  template
- mysqli instead of PDO (at least they didn’t use the old “mysql” module)
- SQL credentials in the source code *facepalm*
- SQL queries in the source code *facepalm*
- disabling the user’s status bar
- Fetching and displaying results row by row instead of in batches
- comparing strings as if they were numeric values :-D
- spaghetti code in event-handler attributes
- *inline* jQuery event listeners (so much for "unobtrusive Javascript") :-D
- jQuery “change” event listeners to uncheck a checkbox instead of canceling
  the “click” event :-D
- HTML5 declared, but not Valid HTML.
 
Bottom line: This code is complete JUNK.  It is a recipe for failure.
A hopeless case.  DOA.  It should be written from scratch before it is 
debugged, otherwise eye cancer and nervous breakdowns could result.

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web