Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2011
    Posts
    20
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Add new form field into complex website template... Any ideas?

    Hi

    I am new to complex coding.

    I am trying to add an extra field to a website that is a complex template.

    It appears that each field in the sign up form has a php page. Here is the 'Your name' coding that i think is for the form field that is driven through php.

    Code:
    <?php
    
    class field_i_am extends fieldType_select
    {
    	/**
    	 * Constructor.
    	 *
    	 * @param string $name
    	 */
    	public function __construct( $name = 'i_am' ) {
    		parent::__construct($name);
    	}
    	
    	
    	public function setup( SK_Form $from )
    	{
    		// TODO: getting values from database
    		$this->values = array(1, 2, 4, 8);
    		
    		$this->setValue(current($this->values));
    		
    		parent::setup($from);
    	}
    	
    }
    And the code that calls it:

    Code:
    <?php
    
    class component_SignUp extends component_FieldForm
    {
    	
    	public function __construct( array $params = null )
    	{
    		if (SK_Config::section('profile_registration')->type == 'invite') {
    			$this->annul();
    		}
    		
    		parent::__construct('sign_up');
    		
    		$this->enable_sections = false;
    		//$this->cache_lifetime = 10;
    	}
    	
    	public function fields(){
    		return array('username', 'password','email','i_agree_with_tos');
    	}
    		
    }
    I think it appears to be a very complex and confusing system.

    If someone knows, how would i add a new field to this template in the sign up form? I want to add a 'Surname', and use this current code as listed above as a 'First Name' field.

    I'm really baffled on this. Any input would be great!

    If you have a thought and would like to see other code from the template then easy, just ask...

    thanks
    steve

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,166
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    And how is this related to MySQL?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    May 2011
    Posts
    20
    Thanks
    5
    Thanked 0 Times in 0 Posts
    yes you are right, sorry for any inconvenience
    sc


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •