ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

form buttons

August 29, 2008 2:26pm

Subscribe [3]
  • #1 / Aug 29, 2008 2:26pm

    aran384

    10 posts

    Hi am wondering whether it is possible to add a ID attribute to the button that is generated by form_submit.

  • #2 / Aug 29, 2008 5:46pm

    Bramme

    574 posts

    RTFM…

    form_input()

    Lets you generate a standard text input field. You can minimally pass the field name and value in the first and second parameter:
    echo form_input(‘username’, ‘johndoe’);

    Or you can pass an associative array containing any data you wish your form to contain:
    $data = array(
              ‘name’      => ‘username’,
              ‘id’      => ‘username’,
              ‘value’    => ‘johndoe’,
              ‘maxlength’  => ‘100’,
              ‘size’      => ‘50’,
              ‘style’    => ‘width:50%’,
            );

    echo form_input($data);

    // Would produce:

    <input type=“text” name=“username” id=“username” value=“johndoe” maxlength=“100” size=“50” style=“width:50%” />

    And then

    form_submit()

    Lets you generate a standard submit button. Simple example:
    echo form_submit(‘mysubmit’, ‘Submit Post!’);

    // Would produce:

    <input type=“submit” name=“mysubmit” value=“Submit Post!” />

    Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes.

  • #3 / Aug 29, 2008 5:53pm

    aran384

    10 posts

    Firstly that is a very inappropriate reply.

    And secondly I did not notice this, you could of quite simply said you can use the array’s like the other variables instead of giving such a reply.

  • #4 / Aug 30, 2008 6:23am

    Bramme

    574 posts

    “Such a reply”? I handed you the solution, by quoting the user guide, what’s wrong with that?

    And okay, RTFM is an acronym with “fucking” it and that’s not a very nice word, but you could’ve bothered a bit more, you didn’t even post this in the right forum category…

  • #5 / Aug 30, 2008 7:16am

    Colin Williams

    2601 posts

    Bramme: JATFQWOSA
    aran384: DBSAWNWPA

    everybody: RTFM twice, UTFM everyday

  • #6 / Aug 30, 2008 3:58pm

    Bramme

    574 posts

    Okay, I’m at a loss… What do those mean? :p

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases