summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSashi202019-03-06 18:21:08 +0530
committerGitHub2019-03-06 18:21:08 +0530
commit7577967964c3194fb3b4107efa61a088c84c6eb4 (patch)
tree702b31da9ed4ebed328846c889e8de676381f8fb
parent899fc1fdb5993ed94c1ed6cd03a1b006b0d18125 (diff)
parent9ecc8ddfcbf1cc2ad9d65f35a6018e1607f3f395 (diff)
downloadopenmodelica_textbook_companion-7577967964c3194fb3b4107efa61a088c84c6eb4.tar.gz
openmodelica_textbook_companion-7577967964c3194fb3b4107efa61a088c84c6eb4.tar.bz2
openmodelica_textbook_companion-7577967964c3194fb3b4107efa61a088c84c6eb4.zip
Merge pull request #7 from Sashi20/drupal_7.x
Mandated the pincode field, added description to other reason field
-rwxr-xr-xtextbook_companion.module11
1 files changed, 10 insertions, 1 deletions
diff --git a/textbook_companion.module b/textbook_companion.module
index ed33638..aa5fbb5 100755
--- a/textbook_companion.module
+++ b/textbook_companion.module
@@ -1911,7 +1911,7 @@ function book_proposal_form($form, &$form_state)
'#title' => t('Pincode'),
'#size' => 30,
'#maxlength' => 6,
- '#required' => False,
+ '#required' => TRUE,
'#attributes' => array(
'placeholder' => 'Enter pincode....'
)
@@ -1994,6 +1994,7 @@ function book_proposal_form($form, &$form_state)
'#type' => 'textarea',
'#size' => 300,
'#maxlength' => 300,
+ '#description'=>t('<span style="color:red;">Maximum character limit is 255 characters</span>'),
'#states' => array(
'visible' => array(
':input[name="reason[Other reason]"]' => array(
@@ -2306,6 +2307,14 @@ function book_proposal_form_validate($form, &$form_state)
/*****************************************************************************
}*/
+ if (isset($form_state['values']['reason']))
+ {
+ $my_reason = $form_state['values']['other_reason'];
+ if($my_reason>255)
+ {
+ form_set_error('other_reason', t('Maximum limit is 255 characters'));
+ }
+ }
if ($form_state['values']['version'] == 'Other version')
{
if ($form_state['values']['other_version'] == '')