Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8001 Posts in 1848 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: CheckBox Input Type  (Read 220 times)
0 Members and 1 Guest are viewing this topic.
Steve
New Member
*

Karma: 0
Offline Offline

Posts: 0

photographer


WWW
« on: January 31, 2003, 09:42:00 AM »

The documentation says somthing about the availability of a check box as one of the input types.  When I look at Calendar Administration: Add/Edit Field, my input type choices are Text, Password, Text Area and Selectbox.

I need field call "Sites" which will list a number of sites wishing to connect.  I want to be able to select any number of sites for an event. Thus, one event may show 2 sites, another 7, another 4, etc.

I tried Selectbox as the input type, but that choice would only allow me to select one site for the event.

Any suggestions?

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 212

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: January 31, 2003, 02:23:00 PM »

** The documentation says somthing about the availability of a check box as one of the input types. **

Yes it does. This is Matt's (CalendarScript's author) reply from a prevoius forum message:

quote:
A Checkbox option used to be in there, but I removed it for several reasons. I will cleanup the docs to correspond to that. Radio buttons were never a supported type. A simple select box can be used in place of both of those options.

I guess Matt hasn't got around to correcting the documentation yet.

It does look like the script has the functions available to deal with them though. You could try editing the add_edit_field.html admin template and adding that option to if it works. I don't know what problems are associated with them.

Find the lines of code in add_edit_field.html :

<TD VALIGN="top"><SELECT NAME="FIELDPROPERTY_type">
<OPTION VALUE=""></OPTION>
<OPTION VALUE="text" <%=(($record->{type} eq "text")?"SELECTED":"")%>>Text</OPTION>
<OPTION VALUE="password" <%=(($record->{type} eq "password")?"SELECTED":"")%>>Password</OPTION>
<OPTION VALUE="textarea" <%=(($record->{type} eq "textarea")?"SELECTED":"")%>>Textarea</OPTION>
<OPTION VALUE="select" <%=(($record->{type} eq "select")?"SELECTED":"")%>>Selectbox</OPTION>
</SELECT>

and adding

<OPTION VALUE="select" <%=(($record->{type} eq "checkbox")?"CHECKED":"")%>>Checkbox</OPTION>

before the </SELECT>

Again, this is untested.

Dan O.

------------------

Logged
Mo Jo Jo Jo
Guest
« Reply #2 on: March 11, 2005, 07:13:00 PM »

This works, but I changed the code to say "checkbox" instead of "select"...

<OPTION VALUE="checkbox" <%=(($record->{type} eq "checkbox")?"CHECKED":"")%>>Checkbox</OPTION>

Logged
Pages: [1]   Go Up
Print
Jump to: