Fork me on GitHub

Trying to make most of form hidden  Bottom

  • I have a form that i would like to make all aspect hidden except for the submit button. The problem is that one of the inputs is supposed to be a checkbox. I need it always "checked", but of course its going to be hidden. The area for adding the username, i will probably just hardcode. Any tips?

    Code

    echo "<form action=\"index.php?module=statistics&amp;func=report\" method=\"post\" enctype=\"application/x-www-form-urlencoded\"><div><input type=\"hidden\" name=\"authid\" value=\"ed31716ecec701050155238010327d32\" /><tr><td>&nbsp</td></tr><tr><td>Statistics Table: <select name=\"ta\" id=\"ta\" size=\"1\" tabindex=\"1\"><option value=\"details\" selected=\"selected\">Details</option><option value=\"archive\">Archive</option><option value=\"summary\">Summary</option></select></td></tr><tr><td> Start Date: <input type=\"text\" name=\"start\" id=\"start\" value=\"2004-12-27\" size=\"16\" maxlength=\"64\" tabindex=\"2\" /> End Date: <input type=\"text\" name=\"end\" id=\"end\" value=\"2005-04-27\" size=\"16\" maxlength=\"64\" tabindex=\"3\" />\n";
    echo "<INPUT id=\"authid\" type=\"hidden\" value=\"".pnSecGenAuthKey()."\" name=\"authid\">\n";
    echo "<INPUT id=\"ud\" type=\"hidden\" value=\"1\">\n";
    echo "<input type=\"checkbox\" name=\"ud\" id=\"ud\" value=\"1\" tabindex=\"1\" />\n";
    echo "<input type=\"text\" name=\"udu\" id=\"udu\" value=\"every\" size=\"16\" maxlength=\"64\" tabindex=\"2\" />\n";
    echo "<INPUT type=\"submit\" value=\"Submit\"></FORM>\n";


    EDIT: Sure wish the code wasnt so messed up like that, would be easier to read.
  • Why do you need the checkbox? Why not just a hidden input to pass the values?

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • i dont need the checkbox. I tried a hidden input such as:

    Code

    <INPUT id=\"ud\" type=\"hidden\" value=\"1\">


    But that didnt seem to work. I dont know. i have made some changes since then, can try it again.
  • ah, i c what i was missing, forgot to send the id:

    Code

    <input type=\"hidden\" name=\"ud\" id=\"ud\" value=\"1\" />
  • When you have a checkbox the data passed will just be a value, anyway, so you should be able to use a hidden field just the same. I noticed that you don't have a name for the hidden field, which could also be a problem.
  • Yes, you need the name parameter.

    the id parameter is useful when you want to be accesible about your forms.

    i.e.

    <label for="uname">Username:</label>

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • I actually got things working perfectly now. Thanks guys! Want to give this one form problem a try?

    Here
  • I know how to get todays date in PHP, but how would i do get the date X days ago. Lets say i want the "start date" to be 90 days before the "end date", which would be today.
  • got it

    Code

    $end = date("Y-m-d");
    $start= date("Y-m-d", strtotime("-3 month ".$date));
  • 0 users

This list is based on users active over the last 60 minutes.