Here's a link to my newest module: http://drupal.org/node/37339
Whilst I know I should be concentrating on my other module which needs a whole lot more work, I feel that taking a break from it has given me more ideas about how to handle it which is all good :o) But not what this post is about...
In my newest module, on the page: http://drupal.org/project/Modules My module has the embarrassingly longest preview... I've completely forgotten how to put my own line break in it, could somone please let me know!!! :o) Thanks!
The module works fine as it is, but I've been perfecting it ;o) I've come across a problem though with the way I've done something with it. Here's an example (easier to follow than the real code!):
function tablemanager_tableadd() {
if(isset($_POST['create'])) {
if (!form_get_errors()) {
//create db entry
}
}
if(isset($_POST['submit'])) {
if (!form_get_errors()) {
//display fields and let user name them
//make 'create' button
}
}
//main code
//allow user to name table and set how many columns are in table
//make 'submit' button
}
Now all that works absolutely beautifully :o) Unless the user enters something the validation doesn't like... For the first screen it's fine because the code 'runs though' into the first part and marks the box in red where there's been an input error. However for the second screen, when the user makes a mistake they're sent back to the very first screen because the second screen is 'hidden' by the isset($_POST['submit']) statement. I was under the impression that I could set the POST variable manually so that the user will be nicely shown what he's entered wrongly? If I type: