This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Where in PHP to Assign ID to Input Buttons - "Add Comment", "Preview"
#1

First of all thank you for this wonderful commenting system! Setup and customization has gone very well.

I have modified the css to fit within my site, however looking through the "Add Comment" and "Preview" input buttons, they contain no id or class and will only accept a call to globally modify all submit buttons. I have submit buttons in the rest of my site that I don't really want inheriting this.

Can you tell me in which PHP file I can modify the tags to include IDs so that I can assign ID selectors in my CSS.

Thank you for your help! Smile
Reply
#2

Hi,

The file is /comments/includes/template/form.php

There are two lines of code for the submit button. The first line (line 856) is for when the submit button is disabled, and the second line (line 858) is for when it's not disabled.

Same with the preview button, but lines 865 and 867.

I think the reason I didn't add a class or ID was because I used an inline style (which is set on line 837) to make the buttons green if the admin is detected, and I felt that the inline style may have conflicted with a class or ID.

Have you completed the interview?
Reply
#3

Reply
#4

Thanks, I'll incorporate this into the next version.

Have you completed the interview?
Reply
#5

Many Drupal forms contain a submit button with id="edit-submit" when you don't supply one yourself, as does the Switch Theme module.
<?php
$form['submit'] = array( '#type' => 'submit', '#value' => t('Switch'));
?>
NEW Line 126:

<?php
$form['submit'] = array('#id'=>'switchtheme-submit', '#type' => 'submit', '#value' => t('Switch'));
?>
This change assists when trying to make a valid XHTML 1.0 site in Drupal as ID attributes should be unique throughout a page.

Thanks for the module, it works great.

PS: In this post, I added the php tags to each line to make the markup easier to read, they obviously aren't needed in the module file.
Reply
#6

Hi,

Did you integrate Commentics into Drupal? Would you mind posting the steps for the Implementations page.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
29-Sep-2021, 11:41 AM
Last Post by afoster
02-Aug-2020, 10:40 PM
Last Post by Steven
02-Jun-2020, 06:44 PM
Last Post by Steven
10-Jan-2018, 09:58 PM
Last Post by noblues
08-Mar-2015, 05:08 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)