By Spillerspoiler on
I can't understand whats wrong in my edit:
Original part of code:
$form['subscribe'] = array('#type' => 'submit',
'#value' => t('Subscribe'),
'#weight' => 20,
);
$form['unsubscribe'] = array('#type' => 'submit',
'#value' => t('Unsubscribe'),
'#weight' => 30,
);
}
return $form;
}
My edit: (I was trying to add DIV class "rightmove" to this part of code")
$form['subscribe'] = '<div class="rightmove">' array('#type' => 'submit',
'#value' => t('Subscribe'),
'#weight' => 20,
);
$form['unsubscribe'] = array('#type' => 'submit',
'#value' => t('Unsubscribe'),
'#weight' => 30,
);
'</div>'
}
return $form;
}
Tell me the right way of adding html tags to the code like this ...
Comments
Form elements have two
Form elements have two special options you can do this with: $prefix and #suffix
Example:
For more information see: #prefix and #suffix.
Not working =((( Edited
Not working =(((
Edited .module http://decustom.ru/simplenews.module
strings 971-985
okay, so whats not working
okay, so whats not working again? Is the button being rendered? Have you looked at the HTML source code on the page that is supposed to have this form? Have you tried clearing Drupal's cache?
I can't see div class....
I can't see div class.... Module works, but still there is no div class. Cache is ok....
in your module, you are
in your module, you are using p tags for the prefix and suffix:
Lines 973-982 (or thereabouts)
still no working =(((( I
still no working =((((
I need to : http://i052.radikal.ru/0806/02/b54755916bb2.jpg
and original module http://drupal.org/project/simplenews
Help me please! =)
nobody can? =(
nobody can? =(
If you followed aj045's
If you followed aj045's example things should be fine by now.
can you show us your code? your first post was obviously filled with PHP syntax errors.
I tried this and worked for me.
You can also use a nested
You can also use a nested array and then set TREE=true
spillerspoiler, try writing
spillerspoiler,
try writing another module at test your piece of code that is breaking-- just that code. if it works in a test module, but not in your main module, you've got a problem some where. That's the breaks with debugging-- it's hard, especially if you gotta do it by hand.
Use #prefix and #suffix
Use #prefix and #suffix (see: http://api.drupal.org/api/file/developer/topics/forms_api_reference.html/5).
Better than hacking code is to theme the form: http://drupal.org/node/112358
-- Erik
-- Erik