Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-05-2016, 03:20 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 64,843
Dinocanid is on a distinguished road
Default Buttons with different actions?

I'm pretty confused on how to use buttons. I know how to make them appear but I don't know how to make them do anything. I know I could use code similar to the many forms around the site like so:
PHP Code:
if($mysidia->input->post("submit")){
            
$document->setTitle($this->lang->rename_success_title);
            
$document->add($image);
            
$message "<br>{$this->lang->rename_success}{$mysidia->input->post("adoptname")}
                        You can now manage 
{$mysidia->input->post("adoptname")} on the";
            
$document->addLangvar($message);
            
$document->add(new Link("myadopts/manage/{$adopt->getAdoptID()}""My Adopts Page"));
            
$adopt->setHealth($addHealth"update");
                        if (
$health 100){$adopt->setHealth(100"update");
            
$document->add(new Comment("<br></br>{$adopt->getName()} has full health!"));
            }
            
            return;
        }
        
        
$document->setTitle($this->lang->rename.$adopt->getName());
        
$document->add($image);
        
$document->addLangvar("<br />{$this->lang->rename_default}{$adopt->getName()}{$this->lang->rename_details}<br />");
        
        
$renameForm = new FormBuilder("renameform""""post");
        
$renameForm->buildTextField("adoptname")->buildButton("Rename Adopt""submit""submit");
        
$document->add($renameForm); 
(The health part was from me testing my health mod btw, so you can ignore that part)
But what if I wanted two buttons on the same page that do different things when clicked? For example, I want to have two different buttons, one that lowers a value when clicked and another that raises a value. Would I have to have two forms?

EDIT: I figured it out. I had to use two forms
__________________

Last edited by Dinocanid; 12-05-2016 at 06:26 PM.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:03 PM.

Currently Active Users: 598 (0 members and 598 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636