Posted by sagarmitra on December 17, 2010 at 5:30am
How can i populate the form fields programmatically
Let me illustrate, consider the following example
<?php
function form(){
return drupal_get_form('myform');
}
function myform($form_state){
$form['name'] = array(
'#type' => 'textfield',
'$title' => 'Name: ',
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Save',
);
return $form;
}
function myform_submit($form,&$form_state){
$form_id = 'myform';
$form_state['values']['name'] = 'Hello World';
drupal_execute($form_id,$form_state);
}
?>
Here, when submit event occurs, instead of getting the values populated, i get the white blank screen of death on the screen. Is something wrong with my syntax??
Comments
There is absolutely no reason
There is absolutely no reason this should have been sent out to all these groups, if you have a support question it would be much better to post this in the forums on d.o. at http://drupal.org/forum
Drupal evangelist.
www.CoderintheRye.com
Good evening, Happy Holidays!
Good evening,
Happy Holidays! I am trying to create a site similar, in structure, to this one: http://www.skelbiu.lt/. I know that views will be helpful in creating this type of website format. I'm trying to figure out, though, how to get links connected to each category. Any knowledge of how to do this? Thanks in advance!
Best,
Marcus
HI Marcus
You can use taxonomy for categorizing the content , then inside the view you can filter by node type , and get the count of for the corresponding category .
If you have still doubt plz contact me in bellow details, I am ready to help you .
E-mail: rabithk@gmail.com or Mobile: +91 8123553474
With Regards,
Rabith.k
E-mail: rabithk@gmail.com
Mobile: +91 8123553474
Regards,
Rabith Kuniyil.