Hi am wondering whether it is possible to add a ID attribute to the button that is generated by form_submit.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
August 29, 2008 2:26pm
Subscribe [3]#1 / Aug 29, 2008 2:26pm
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
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
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
“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
Bramme: JATFQWOSA
aran384: DBSAWNWPA
everybody: RTFM twice, UTFM everyday
#6 / Aug 30, 2008 3:58pm
Okay, I’m at a loss… What do those mean? :p