Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Default the select checkbox to 'selected'
Default the select checkbox to 'selected' [message #2082] Tue, 19 May 2009 11:44 Go to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Is there a way to set the select checkboc to 'selected' within a transaction?

I have a LIST1 transaction that is restricted to having only one entry within the code. I'd like to be able to set the checkbox to 'selected' on display. Even better would be to remove the checkbox from the screen (easy to do) but have it selected by default.
Re: Default the select checkbox to 'selected' [message #2083 is a reply to message #2082] Tue, 19 May 2009 11:59 Go to previous message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
Simple. All you have to do is put code similar to the following in the _cm_post_geData() method:
    foreach ($rows as $rownum => $rowdata) {
        if ($rowdata['id'] == 'whatever') {
            $rows[$rownum]['selected'] = true;
        } // if
    } // foreach

It would be a waste of time removing the select box from the screen as there would be no way to mark the row as selected.


Previous Topic: problem extending a table class
Next Topic: Restrict the input size of a multi-line text box
Goto Forum:
  


Current Time: Thu Nov 28 01:55:20 EST 2024

Total time taken to generate the page: 0.03074 seconds