473,799 Members | 3,442 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Radio buttons do not appear checked

<b>Agency 4</b>
<input type="radio" name="permissio n[4]" value="1" checked> Yes
<input type="radio" name="permissio n[4]" value="0" > No
<br>
<b>Agency 5</b>
<input type="radio" name="permissio n[5]" value="1" checked> Yes
<input type="radio" name="permissio n[5]" value="0" > No
<br>
I have it set up this way but upon viewing in the browser none of the
radio buttons appear checked.

By the way the radio button names MUST remain in the PHP array format
as they will be referenced EXACTLY like that by PHP on the server end.
Sorry can't change that.

What can I do?

Phil
Jul 20 '05 #1
23 2463
I think what you want want is to change your input type to "checkbox"

Cheers,
Mike

"Phil Powell" <so*****@erols. com> wrote in message
news:1c******** *************** ***@posting.goo gle.com...
<b>Agency 4</b>
<input type="radio" name="permissio n[4]" value="1" checked> Yes
<input type="radio" name="permissio n[4]" value="0" > No
<br>
<b>Agency 5</b>
<input type="radio" name="permissio n[5]" value="1" checked> Yes
<input type="radio" name="permissio n[5]" value="0" > No
<br>
I have it set up this way but upon viewing in the browser none of the
radio buttons appear checked.

By the way the radio button names MUST remain in the PHP array format
as they will be referenced EXACTLY like that by PHP on the server end.
Sorry can't change that.

What can I do?

Phil

Jul 20 '05 #2
On 30 Sep 2003 13:41:13 -0700, so*****@erols.c om (Phil Powell) wrote:
<b>Agency 4</b>
<input type="radio" name="permissio n[4]" value="1" checked> Yes
<input type="radio" name="permissio n[4]" value="0" > No
<br>
<b>Agency 5</b>
<input type="radio" name="permissio n[5]" value="1" checked> Yes
<input type="radio" name="permissio n[5]" value="0" > No
<br>
I have it set up this way but upon viewing in the browser none of the
radio buttons appear checked.


Works for me, on IE6 and Mozilla 1.4. What browser are you using?

--
Andy Hassall (an**@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 20 '05 #3
In article <1c************ **************@ posting.google. com>,
so*****@erols.c om says...
<b>Agency 4</b>
<input type="radio" name="permissio n[4]" value="1" checked> Yes
<input type="radio" name="permissio n[4]" value="0" > No
<br>
<b>Agency 5</b>
<input type="radio" name="permissio n[5]" value="1" checked> Yes
<input type="radio" name="permissio n[5]" value="0" > No
<br>

I have it set up this way but upon viewing in the browser none of the
radio buttons appear checked.

By the way the radio button names MUST remain in the PHP array format
as they will be referenced EXACTLY like that by PHP on the server end.
Sorry can't change that.
Works for me in IE6 and Firebird 0.6.1

What can I do?


Find a more appropriate group. This is neither a PHP nor JavaScript
issue.

--
Hywel I do not eat quiche
http://hyweljenkins.co.uk/
http://hyweljenkins.co.uk/mfaq.php
Jul 20 '05 #4
On Tue, 30 Sep 2003 23:48:57 +0300, "Mike" <no*****@noemai l.com> wrote:
"Phil Powell" <so*****@erols. com> wrote in message
news:1c******* *************** ****@posting.go ogle.com...
<b>Agency 4</b>
<input type="radio" name="permissio n[4]" value="1" checked> Yes
<input type="radio" name="permissio n[4]" value="0" > No


I think what you want want is to change your input type to "checkbox"


Why? How can the reply be 'Yes' and 'No' at the same time? Radio looks the
sensible choice here.

--
Andy Hassall (an**@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 20 '05 #5
VK
Any name has to start with a letter and consist of any combination of
letters, numbers and underscores to the total length of 255 characters.
(Where the "letter" means any character from the a-z, A-Z range)
This is a vary basic of any programming language including JavaScript.
Otherwise you are on the merci of a particular system (browser) - will it
eat your wrong names or not.

Phil Powell <so*****@erols. com> wrote in message
news:1c******** *************** ***@posting.goo gle.com...
<b>Agency 4</b>
<input type="radio" name="permissio n[4]" value="1" checked> Yes
<input type="radio" name="permissio n[4]" value="0" > No
<br>
<b>Agency 5</b>
<input type="radio" name="permissio n[5]" value="1" checked> Yes
<input type="radio" name="permissio n[5]" value="0" > No
<br>
I have it set up this way but upon viewing in the browser none of the
radio buttons appear checked.

By the way the radio button names MUST remain in the PHP array format
as they will be referenced EXACTLY like that by PHP on the server end.
Sorry can't change that.

What can I do?

Phil

Jul 20 '05 #6
On Wed, 1 Oct 2003 01:02:33 +0200, "VK" <sc**********@y ahoo.com> wrote:
Phil Powell <so*****@erols. com> wrote in message
news:1c******* *************** ****@posting.go ogle.com...
<b>Agency 4</b>
<input type="radio" name="permissio n[4]" value="1" checked> Yes
<input type="radio" name="permissio n[4]" value="0" > No
<br>
<b>Agency 5</b>
<input type="radio" name="permissio n[5]" value="1" checked> Yes
<input type="radio" name="permissio n[5]" value="0" > No
<br>

I have it set up this way but upon viewing in the browser none of the
radio buttons appear checked.

By the way the radio button names MUST remain in the PHP array format
as they will be referenced EXACTLY like that by PHP on the server end.
Sorry can't change that.
Any name has to start with a letter and consist of any combination of
letters, numbers and underscores to the total length of 255 characters.
(Where the "letter" means any character from the a-z, A-Z range)


Not true, see below.
This is a vary basic of any programming language including JavaScript.
Otherwise you are on the merci of a particular system (browser) - will it
eat your wrong names or not.


permission[4] is a valid value for the name attribute of the <input> element,
as described in the HTML specification.

The input element's name attribute is of type CDATA with no further
restrictions defined by the specification.

The last discussion I remember of this ended up with these messages:
(very long URL - your newsreader may wrap it)

http://groups.google.co.uk/groups?hl...r%3D%26hl%3Den

The message linked says [] in an input name is invalid, the replies disprove
this.

Individual languages may have trouble with non-alphabetic characters as part
of a name attribute, but it's valid HTML and so should really be possible to
deal with it in any language working with HTML.

(BTW I'm not sure why this is posted to either of the PHP or JavaScript
newsgroups, since the only posted content is in valid HTML)

--
Andy Hassall (an**@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 20 '05 #7
I noticed that Message-ID: <3f************ ***********@new s.freenet.de>
from VK contained the following:
Any name has to start with a letter and consist of any combination of
letters, numbers and underscores to the total length of 255 characters.
(Where the "letter" means any character from the a-z, A-Z range)
This is a vary basic of any programming language including JavaScript.
Otherwise you are on the merci of a particular system (browser) - will it
eat your wrong names or not.


Wish I'd read that earlier. I spent three hours today trying to figure
out a simple javascript problem until I figured out I could not call my
checkboxes 1,2,3, etc

--
Geoff Berrow
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 20 '05 #8
"Andy Hassall" <an**@andyh.co. uk> wrote in message
news:n6******** *************** *********@4ax.c om...
On Wed, 1 Oct 2003 01:02:33 +0200, "VK" <sc**********@y ahoo.com> wrote:
<snip>
Any name has to start with a letter and consist of any
combination of letters, numbers and underscores to the
total length of 255 characters. (Where the "letter" means
any character from the a-z, A-Z range)


Not true, see below.

<snip>
The message linked says [] in an input name is invalid, the
replies disprove this.
I don't think that the discussion that you referenced does prove the
general suggestion that [ and ] are invalid in HTML 4 name attribute
strings is incorrect. If I look at the HTM versions of the DTDs I find
that the Name attributes are described as CDATA and the term CDATA is
linked to:-

<quote cite="http://www.w3.org/TR/html4/types.html#type-cdata">
....
For some HTML 4 attributes with CDATA attribute values, the
specification imposes further constraints on the set of legal values for
the attribute that may not be expressed by the DTD.
....

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens ("-"),
underscores ("_"), colons (":"), and periods (".").
....
</quote>

- which is part of the HTML 4 specification and "imposes further
constraints" on the contents of name attribute strings beyond the normal
definition of CDATA.
Individual languages may have trouble with non-alphabetic
characters as part of a name attribute, but it's valid HTML
and so should really be possible to deal with it in any
language working with HTML.


Valid HTML or not, JavaScript can access properties with names that do
not represent valid identifiers in JavaScript by using square bracket
notation instead of dot notation:-

<URL: http://jibbering.com/faq/#FAQ4_25 >
-and-
<URL: http://jibbering.com/faq/#FAQ4_39 >

Richard.
Jul 20 '05 #9
On Wed, 1 Oct 2003 01:35:37 +0100, "Richard Cornford"
<Ri*****@litote s.demon.co.uk> wrote:
"Andy Hassall" <an**@andyh.co. uk> wrote in message
news:n6******* *************** **********@4ax. com...
On Wed, 1 Oct 2003 01:02:33 +0200, "VK" <sc**********@y ahoo.com>wrote:
<snip>
Any name has to start with a letter and consist of any
combinatio n of letters, numbers and underscores to the
total length of 255 characters. (Where the "letter" means
any character from the a-z, A-Z range)


Not true, see below.

<snip>

The message linked says [] in an input name is invalid, the
replies disprove this.


I don't think that the discussion that you referenced does prove the
general suggestion that [ and ] are invalid in HTML 4 name attribute
strings is incorrect. If I look at the HTM versions of the DTDs I find
that the Name attributes are described as CDATA and the term CDATA is
linked to:-

<quote cite="http://www.w3.org/TR/html4/types.html#type-cdata">
...
For some HTML 4 attributes with CDATA attribute values, the
specificatio n imposes further constraints on the set of legal values for
the attribute that may not be expressed by the DTD.
...

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens ("-"),
underscores ("_"), colons (":"), and periods (".").


The name attribute of input is not one of the ID or NAME types, so that
restriction doesn't apply.

There are attributes that are declared as ID or NAME; input's name attribute
is not one of them.
...
</quote>

- which is part of the HTML 4 specification and "imposes further
constraints" on the contents of name attribute strings beyond the normal
definition of CDATA.


No, the restriction on the NAME and ID types don't apply to the CDATA type.

Quoting the whole lot:

"
* CDATA is a sequence of characters from the document character set and may
include character entities. User agents should interpret attribute values as
follows:
Replace character entities with characters,
Ignore line feeds,
Replace each carriage return or tab with a single space.
User agents may ignore leading and trailing white space in CDATA attribute
values (e.g., " myval " may be interpreted as "myval"). Authors should not
declare attribute values with leading or trailing white space.

For some HTML 4 attributes with CDATA attribute values, the specification
imposes further constraints on the set of legal values for the attribute that
may not be expressed by the DTD.

Although the STYLE and SCRIPT elements use CDATA for their data model, for
these elements, CDATA must be handled differently by user agents. Markup and
entities must be treated as raw text and passed to the application as is. The
first occurrence of the character sequence "</" (end-tag open delimiter) is
treated as terminating the end of the element's content. In valid documents,
this would be the end tag for the element.

* ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by
any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons
(":"), and periods (".").

* IDREF and IDREFS are references to ID tokens defined by other attributes.
IDREF is a single token and IDREFS is a space-separated list of tokens.

* NUMBER tokens must contain at least one digit ([0-9]).
"

So, it's saying that if you look through the specification on some of the
attributes that are of CDATA type, there are then further notes on restrictions
not expressed by it being of type CDATA.

There are no further restrictions listed for input's name attribute that I can
find - if you can see one please post it!

There then follows descriptions of the ID, NAME, IDREF, IDREFS and NUMBER
types; none of which are CDATA, they're separate types.

For example:

http://www.w3.org/TR/html4/struct/li...ml#adef-name-A

The name attribute of the <a> tag is of type CDATA, but it says here that it
is restricted to the namespace of the id attribute, which is of type 'name'.

That's a "further constraint on the set of legal values for the attribute that
may not be expressed by the DTD"
Individual languages may have trouble with non-alphabetic
characters as part of a name attribute, but it's valid HTML
and so should really be possible to deal with it in any
language working with HTML.


Valid HTML or not, JavaScript can access properties with names that do
not represent valid identifiers in JavaScript by using square bracket
notation instead of dot notation:-

<URL: http://jibbering.com/faq/#FAQ4_25 >
-and-
<URL: http://jibbering.com/faq/#FAQ4_39 >


Sounds good.

--
Andy Hassall (an**@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
10805
by: Phil Powell | last post by:
<b>Agency 4</b> <input type="radio" name="permission" value="1" checked> Yes <input type="radio" name="permission" value="0" > No <br> <b>Agency 5</b> <input type="radio" name="permission" value="1" checked> Yes <input type="radio" name="permission" value="0" > No <br>
2
3156
by: Jeff | last post by:
I'm trying to create a dynamic form that can have multiple groups of radio buttons (each group has two buttons) with the same name. Essentially, the form allows a user to enter as many names as they want. If they need to add more, they click an "add name" button and the javascript inserts another row of input boxes. Each row should have two radio buttons to indicate sex (M F). When you have multiple text input boxes with the same...
4
3283
by: Oscar Monteiro | last post by:
I Have to sets of Radio buttons like so: <input type="radio" name=p1 value=1> <input type="radio" name=p1 value=2> <input type="radio" name=p1 value=3> <br> <input type="radio" name=p2 value=1> <input type="radio" name=p2 value=2> <input type="radio" name=p2 value=3> then a text area and a button:
6
3295
by: Craig Keightley | last post by:
I have a page that has n number of radio groups (yes/No) how can i prevent the form being submitted if more than one radio group is not selected? By default all radio groups are unchecked The problem i am facing is that i do not know how many yes/no radio groups will be generated
6
11189
by: juli | last post by:
Hello, I need a control which will contain radio buttons that will be added in a loop. I am using this control a source of some other control. I tried to use group box windows control and to add the radio buttons this way(in a loop): this.groupBox1.Controls.Add(radio); but I can see there only one radio button . How can I see all of them or maybe I should use some kind of radio buttons array first?
2
3495
by: NishSF | last post by:
Would anyone have any suggestions/javascript code so that if one clicks the Radio Button "Yes" below he has the option of selecting any of the six CheckBox below. If the user clicks on Radio Button "No", he should not have the option of clicking on any of the six checkboxes. See Code attached. Thank you so much in advance for your help as I can't get to make this combo work. <p>Did you have any problems finding any of the information...
1
8860
by: Jerry | last post by:
We have a 10-question quiz for kids, each question being a yes or no answer using radio selections. I'd like to keep a current total of yes's and no's at the bottom of the quiz (if the user selects yes to question 1, the total of yes's increases by 1). I've been searching for a while but I'm not sure I'm searching with the right keywords. Can anyone direct me to a source I can review to learn how to do this? Thanks! --
7
2534
by: nathaniel.k.lee | last post by:
Is it not possible, in IE, to dynamically click a radio button? I'm grabbing some values from a database and using them to populate radio buttons on a page. I have alternate code for Firefox browsers using the setAttribute() function. Everything works as planned in Firefox but in IE, the buttons won't populate and, what's worse, I can't even click on them after everything loads. I see the slight shadow that indicates you're clicking on a...
2
5896
by: dpazza | last post by:
Hi, I'm creating a quiz on using a form in VB 2005 express. I have four sets of questions and answers (labels and radio buttons) and I change between which set of questions is currently shown on the form by changing the visible state of the radio buttons and labels utilising back and next buttons. E.g. Next button makes current radio buttons and labels invisible and
4
3093
by: Z.K. | last post by:
I started a forms application and I put on the form three buttons. In the functions for the radio buttons I put in a single messagebox like: MessageBox("Hello 1") MessageBox("Hello 2") MessageBox("Hello 3")
0
10259
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9077
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.