Register for your free account! | Forgot your password?

Go Back   elitepvpers › Coders Den › Web Development
You last visited: Today at 13:36

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



PHP Code help.

Discussion on PHP Code help. within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
Rappelz-Zesua's Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 140
Received Thanks: 61
PHP Code help.

Hello, I have this webpage and it's very annoying I want the 'Buy' button to disappear once clicked but everything I try never works!

So if anybody could help please... I will be very appreciative! The button I want to disappear is in red.

Code:
if(is_promo($identificateur)){
$price=$item_price_p;
}else{
$price=$item_price;
}

}

if($cash>=$price){
$fenetre_deter='<td width="50"><img src="image/icon_success.gif" width="44" height="44" /></td>
                      <td align="left" class="warning">You have enough Donation Points.<br />
    							Would you like to buy this item?</td>';
[COLOR="Red"][B]$btn_achat_recharge='<a href="transaction.php?comfirm=1&id='.$identificateur.'&categorie='.$_GET['categorie'].'&page='.$_GET['page'].'"><img src="image/EN/button_buy_on.gif" width="81" height="32" border="0"</a>';[/B][/COLOR]
$_SESSION['comfirmation_achat']=$identificateur;
}else{
$fenetre_deter='<td width="50"><img src="image/icon_warning.gif" width="44" height="44" /></td>
                      <td align="left" class="warning">You do not enough Donation Points to buy this item.<br />
    							Would you like to buy more Donation Points?</td>';
$btn_achat_recharge='<a href="" target="_blank"><img src="image/EN/button_buy02.gif" width="81" height="32" border="0" /></a>';
}


require('file03.php');
}
?>
Rappelz-Zesua is offline  
Old   #2

 
elite*gold: 140
Join Date: Aug 2007
Posts: 335
Received Thanks: 147
You have to use some Javascript Code and maybe set some states as data attributes,
if you want manipulate your DOM elements without refreshing the whole site.

If you wanna use JQuery (I prefer) take a look at this:


And add a attribute to your buttons like:
data-state="1"
telcy is offline  
Old   #3
 
Rappelz-Zesua's Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 140
Received Thanks: 61
Quote:
Originally Posted by telcy View Post
You have to use some Javascript Code and maybe set some states as data attributes,
if you want manipulate your DOM elements without refreshing the whole site.

If you wanna use JQuery (I prefer) take a look at this:


And add a attribute to your buttons like:
data-state="1"
I did this it didn't work well for me, doesn't work I don't know what it is... Most probably I am just to noobie, haha.
Rappelz-Zesua is offline  
Old   #4

 
Veyd's Avatar
 
elite*gold: 15
Join Date: Mar 2010
Posts: 149
Received Thanks: 11
jQuery

Code:
<head>
    <script src="http://code.jquery.com/jquery-1.5.js"></script>
</head>
<body>
    <button>Hide me!</button>
    <script>
        $("button").click(function () {
            $("button").hide();
        });   
    </script>


bad but work:
Code:
<head>
    <script src="http://code.jquery.com/jquery-1.5.js"></script>
</head>
<body>
    <form>
        <input type="submit" />
    </form>
    <script>
        $('form').submit(function(){
            $('input[type=submit]', this).val('uploading ... ').attr('disabled',true);
        });
    </script>
</body>
the last code makes the button "for ever" disabled when you dont have any refresh.

Veyd is offline  
Old   #5
 
Rappelz-Zesua's Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 140
Received Thanks: 61
bump still not worked it out. lol
Rappelz-Zesua is offline  
Old   #6

 
xEncounter's Avatar
 
elite*gold: 22
Join Date: Nov 2009
Posts: 1,552
Received Thanks: 361
what exactly does not work ?

Every solution here should work..
xEncounter is offline  
Old   #7
 
Looh's Avatar
 
elite*gold: 2
Join Date: Mar 2013
Posts: 555
Received Thanks: 250
PHP Code:
<head>
    <
script src="http://code.jquery.com/jquery-1.5.js"></script>
</
head>
<
body>
    <
form>
        <
input type="submit" />
    </
form>
    <
script>
        $(
'form').submit(function(){
            $(
'input[type=submit]', this).val('uploading ... ').attr('disabled',true);
        });
    </
script>
</
body> 
Whats wrong, or whats bad with this?
Looh is offline  
Old   #8
 
elite*gold: 200
Join Date: Apr 2012
Posts: 577
Received Thanks: 290
Try to add Document ready function normaly not needed but give it a try.
Quote:

<head>
<script src="http://code.jquery.com/jquery-1.5.js"></script>
</head>
<body>
<form>
<input type="submit" />
</form>
<script>
$(document).ready(function() {
$('form').submit(function(){
$('input[type=submit]', this).val('uploading ... ').attr('disabled',true);
});
});
</script>
</body>
Kind Regards
MartPwnS
MartPwnS is offline  
Old   #9
 
BigM''s Avatar
 
elite*gold: 11
Join Date: Nov 2009
Posts: 1,247
Received Thanks: 363
Could you print the error logged by Firefox in his web-console or any other similar browser? And make sure that JS is enabled in your browser!
BigM' is offline  
Old   #10
 
Rappelz-Zesua's Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 140
Received Thanks: 61
The problem I have with it is I am really not good at writing stuff like this, Examples don't really help me(So it's written out into my code is the only way I will get it to work) Again Sorry about being so nooby
Rappelz-Zesua is offline  
Reply


Similar Threads Similar Threads
[GAMESCOM-SHOP] Vindictus Code, FireFall BETA Code, McGame.com Code, Victory Ukash
10/18/2012 - elite*gold Trading - 8 Replies
Hallo Leute hab ein paar Sachen auf der Gamescom gesammelt und übrig, diese möchte ich hier verkaufen. Ich akzeptiere nur Paypal, E*gold und Paysafecards! Hier ist eine Liste mit Bildern (natürlich sind die Codes zensiert :D): 1. Firefall Beta KEY Ihr macht den Preis! Bild 2. Vindictus Code 50 e*gold Bild
used king Rammus code OR katarina kitty cat code (KR) → used PAX sivir code (NA / EU)
08/21/2012 - League of Legends Trading - 1 Replies
your "already used in the NA / EU servers is Pax Sivir Code" Do you have? Want to exchange "Pax Sivir Code" I "king Rammus code OR Katarina kitty cat code" will provide I use this code in the NA / EU servers did not. just. South Korea on a server, you should not use Pax Sivir Code. If you are interested in this deal, contact me. e-mail: [email protected]
used king Rammus code OR katarina kitty cat code (KR) → used PAX sivir code (NA / EU)
08/20/2012 - League of Legends Trading - 0 Replies
Hello Korea is my server users. I NA / EU servers have already been used in the "Pax Sivir Code" wants As a reward, "king Rammus code OR Katarina kitty cat code" I will send you to gift. Have already used the code, Feel free to do the exchange! Please send mail [email protected]



All times are GMT +2. The time now is 13:36.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.