No it can't.
If we want the discount to be when they add 20 to the field, I want that value to be made 20 via our database.
The Input field cannot be typed in.
So how do I inject it into that code?
Show DIV if input field is >= $row->number
Moderator: General Moderators
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Show DIV if input field is >= $row->number
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Show DIV if input field is >= $row->number
JavaScript runs client side. I can manipulate any code that exists on my machine. I can, therefore, change the value of the markup, revealing the hidden box whenever I please. What you need here is additional server-side validation to protect against tampering. As for injecting it, just use a data attribute like I suggested earlier.
Code: Select all
<div class="some-wrapper" data-threshold="10">
<input foo bar etc>
</div>-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Show DIV if input field is >= $row->number
Can I simply do this?
I can pop that value into a variable on a query just above the code.
IT doesn't matter too much, because the Cart is run from a separate system, so even if they hacked it, it would not do it anything - it's more for just a bit of "sales patter" to say "hey... yes you have added a value that means you get a free lollipop"... lol.
Code: Select all
<script>
var threshold = '<?php echo $specialnumber;?>';
... <script>IT doesn't matter too much, because the Cart is run from a separate system, so even if they hacked it, it would not do it anything - it's more for just a bit of "sales patter" to say "hey... yes you have added a value that means you get a free lollipop"... lol.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Show DIV if input field is >= $row->number
You could, though that does nothing to prevent the end user from manipulating that value.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Show DIV if input field is >= $row->number
Bingo! 
As I say, it's control "stringently" by our external cart system.
This is more just for the "flannel"... lol.
The pricing and stuff isn't actually passed over!
As I say, it's control "stringently" by our external cart system.
This is more just for the "flannel"... lol.
The pricing and stuff isn't actually passed over!
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.