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 09-27-2014, 02:41 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 22,450
IntoRain is on a distinguished road
Default

Example of how to create a form, a dropdown list with options, display them and then retrieve information from the dropdown list:

PHP Code:
            //create a form: Form(form_name, page_to_redirect, method)
            
$formExample = new Form("exampleform""page_to_send_to_here""post");
            
            
//create a dropdown list object: DropdownList(name)
             
$exampleDropdown = new DropdownList("myList");
              
              
//add options to dropdown list: Option(option_name_displayed, option_value)
                 
$exampleDropdown->add(new Option("Option1""option1")); 
                 
$exampleDropdown->add(new Option("Option2""option2")); 
                 
                 
//add dropdown list to form
                 
$formExample->add($exampleDropdown);
                 
//add button to form
                 
$formExample->add(new Button("Click Me""submit""submit"));
                 
//add form to document to display it
                 
$document->add($formExample);   
                 
                 
//after clicking button to submit form
                 
if($mysidia->input->post("submit")){
                       
//retrieve option selected in the dropdown list, by the dropdown list name
                       
$chosenOption $mysidia->input->post("myList");
                       
$document->add(new Comment("I chose this: {$chosenOption}"));
                 } 
__________________


asp.net stole my soul.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is the formatting for form buttons? Infernette Questions and Supports 4 06-18-2015 06:47 PM
Drop Down List to Use Item Messed Up Abronsyth Questions and Supports 4 12-30-2014 10:37 AM
Too many drop down bars? Infernette Questions and Supports 4 01-29-2013 04:01 PM
Submit form Cindykt Questions and Supports 2 08-30-2011 07:47 AM
Alonaria - Human Form alonaria Art Gallery 6 02-26-2011 11:09 AM


All times are GMT -5. The time now is 04:59 AM.

Currently Active Users: 2183 (0 members and 2183 guests)
Threads: 4,081, Posts: 32,032, 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636