473,769 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

call finction to set a radio button

I can not see what the problem is with this script. I am just trying to
set a radio button by calling setCheckedValue ('abbr_letter', 'V'). Sorry
I am new to javascript.
<html>
<head>
<script type="text/javascript">
function setCheckedValue (radioObj, newValue) {
if(!radioObj)
return;

var radioLength = radioObj.length ;
if(radioLength == undefined) {
radioObj.checke d = (radioObj.value == newValue.toStri ng());
return;
}
for(var i = 0; i < radioLength; i++) {
radioObj[i].checked = false;
if(radioObj[i].value == newValue.toStri ng()) {
radioObj[i].checked = true;
}
}
}
function disp_alert()
{
alert("I am an alert box!!")
}
</SCRIPT>
</head>
<body>
<b><FORM NAME="author_ab brv" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>"></b>
<table>
<tr>
<td><input type="radio" name="abbr_lett er" value="A"
onclick="submit ()"A </td>
<td><input type="radio" name="abbr_lett er" value="B"
onclick="submit ()"B </td>
<td><input type="radio" name="abbr_lett er" value="C"
onclick="submit ()"C </td>
<td><input type="radio" name="abbr_lett er" value="D"
onclick="submit ()"D </td>
<td><input type="radio" name="abbr_lett er" value="E"
onclick="submit ()"E </td>
<td><input type="radio" name="abbr_lett er" value="F"
onclick="submit ()"F </td>
<td><input type="radio" name="abbr_lett er" value="G"
onclick="submit ()"G </td>
<td><input type="radio" name="abbr_lett er" value="H"
onclick="submit ()"H </td>
<td><input type="radio" name="abbr_lett er" value="I"
onclick="submit ()"I </td>
<td><input type="radio" name="abbr_lett er" value="J"
onclick="submit ()"J </td>
<td><input type="radio" name="abbr_lett er" value="K"
onclick="submit ()"K </td>
<td><input type="radio" name="abbr_lett er" value="L"
onclick="submit ()"L </td>
<td><input type="radio" name="abbr_lett er" value="M"
onclick="submit ()"M </td>
</tr>
<tr>
<td><input type="radio" name="abbr_lett er" value="N"
onclick="submit ()"N </td>
<td><input type="radio" name="abbr_lett er" value="O"
onclick="submit ()"O </td>
<td><input type="radio" name="abbr_lett er" value="P"
onclick="submit ()"P </td>
<td><input type="radio" name="abbr_lett er" value="Q"
onclick="submit ()"Q </td>
<td><input type="radio" name="abbr_lett er" value="R"
onclick="submit ()"R </td>
<td><input type="radio" name="abbr_lett er" value="S"
onclick="submit ()"S </td>
<td><input type="radio" name="abbr_lett er" value="T"
onclick="submit ()"T </td>
<td><input type="radio" name="abbr_lett er" value="U"
onclick="submit ()"U </td>
<td><input type="radio" name="abbr_lett er" value="V"
onclick="submit ()"V </td>
<td><input type="radio" name="abbr_lett er" value="W"
onclick="submit ()"W </td>
<td><input type="radio" name="abbr_lett er" value="X"
onclick="submit ()"X </td>
<td><input type="radio" name="abbr_lett er" value="Y"
onclick="submit ()"Y </td>
<td><input type="radio" name="abbr_lett er" value="Z"
onclick="submit ()"Z </td>
</tr>
</TABLE>
<input type="button" onclick="setChe ckedValue('abbr _letter', 'V')"
value="Set Radio Button">
<input type="button" onclick="disp_a lert()" value="Display alert box">
</FORM>
</body>
--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
_______________ _______________ _______________ _______________ __________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Nov 12 '06 #1
9 2253
IchBin wrote:
I can not see what the problem is with this script. I am just trying to
set a radio button by calling setCheckedValue ('abbr_letter', 'V'). Sorry
I am new to javascript.
<html>
<head>
<script type="text/javascript">
function setCheckedValue (radioObj, newValue) {
if(!radioObj)
return;

var radioLength = radioObj.length ;
if(radioLength == undefined) {
radioObj.checke d = (radioObj.value == newValue.toStri ng());
return;
}
for(var i = 0; i < radioLength; i++) {
radioObj[i].checked = false;
if(radioObj[i].value == newValue.toStri ng()) {
radioObj[i].checked = true;
}
}
}
function disp_alert()
{
alert("I am an alert box!!")
}
</SCRIPT>
</head>
<body>
<b><FORM NAME="author_ab brv" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>"></b>
<table>
<tr>
<td><input type="radio" name="abbr_lett er" value="A"
onclick="submit ()"A </td>
<td><input type="radio" name="abbr_lett er" value="B"
onclick="submit ()"B </td>
<td><input type="radio" name="abbr_lett er" value="C"
onclick="submit ()"C </td>
<td><input type="radio" name="abbr_lett er" value="D"
onclick="submit ()"D </td>
<td><input type="radio" name="abbr_lett er" value="E"
onclick="submit ()"E </td>
<td><input type="radio" name="abbr_lett er" value="F"
onclick="submit ()"F </td>
<td><input type="radio" name="abbr_lett er" value="G"
onclick="submit ()"G </td>
<td><input type="radio" name="abbr_lett er" value="H"
onclick="submit ()"H </td>
<td><input type="radio" name="abbr_lett er" value="I"
onclick="submit ()"I </td>
<td><input type="radio" name="abbr_lett er" value="J"
onclick="submit ()"J </td>
<td><input type="radio" name="abbr_lett er" value="K"
onclick="submit ()"K </td>
<td><input type="radio" name="abbr_lett er" value="L"
onclick="submit ()"L </td>
<td><input type="radio" name="abbr_lett er" value="M"
onclick="submit ()"M </td>
</tr>
<tr>
<td><input type="radio" name="abbr_lett er" value="N"
onclick="submit ()"N </td>
<td><input type="radio" name="abbr_lett er" value="O"
onclick="submit ()"O </td>
<td><input type="radio" name="abbr_lett er" value="P"
onclick="submit ()"P </td>
<td><input type="radio" name="abbr_lett er" value="Q"
onclick="submit ()"Q </td>
<td><input type="radio" name="abbr_lett er" value="R"
onclick="submit ()"R </td>
<td><input type="radio" name="abbr_lett er" value="S"
onclick="submit ()"S </td>
<td><input type="radio" name="abbr_lett er" value="T"
onclick="submit ()"T </td>
<td><input type="radio" name="abbr_lett er" value="U"
onclick="submit ()"U </td>
<td><input type="radio" name="abbr_lett er" value="V"
onclick="submit ()"V </td>
<td><input type="radio" name="abbr_lett er" value="W"
onclick="submit ()"W </td>
<td><input type="radio" name="abbr_lett er" value="X"
onclick="submit ()"X </td>
<td><input type="radio" name="abbr_lett er" value="Y"
onclick="submit ()"Y </td>
<td><input type="radio" name="abbr_lett er" value="Z"
onclick="submit ()"Z </td>
</tr>
</TABLE>
<input type="button" onclick="setChe ckedValue('abbr _letter', 'V')"
value="Set Radio Button">
<input type="button" onclick="disp_a lert()" value="Display alert box">
</FORM>
</body>

I rewrote the function and it works. I thought that the old function
should work..

function setCheckedValue (newValue) {
var len = document.author _abbrv.abbr_let ter.length
for(var i = 0; i < len; i++) {
document.author _abbrv.abbr_let ter[i].checked = false;
if(document.aut hor_abbrv.abbr_ letter[i].value ==
newValue.toStri ng()) {
document.author _abbrv.abbr_let ter[i].checked = true;
}
}
}

--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
_______________ _______________ _______________ _______________ __________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Nov 12 '06 #2
IchBin wrote on 12 nov 2006 in comp.lang.javas cript:
<b><FORM NAME="author_ab brv" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>"></b>
Dear YouAre,

Why do you make bold an element part the does not display anything?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 12 '06 #3
Lee
IchBin said:
>
IchBin wrote:
>I can not see what the problem is with this script. I am just trying to
set a radio button by calling setCheckedValue ('abbr_letter', 'V'). Sorry
I am new to javascript.
<html>
<head>
<script type="text/javascript">
function setCheckedValue (radioObj, newValue) {
if(!radioObj)
return;

var radioLength = radioObj.length ;
if(radioLength == undefined) {
radioObj.checke d = (radioObj.value == newValue.toStri ng());
return;
}
for(var i = 0; i < radioLength; i++) {
radioObj[i].checked = false;
if(radioObj[i].value == newValue.toStri ng()) {
radioObj[i].checked = true;
}
}
}
function disp_alert()
{
alert("I am an alert box!!")
}
</SCRIPT>
</head>
<body>
<b><FORM NAME="author_ab brv" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>"></b>
<table>
<tr>
<td><input type="radio" name="abbr_lett er" value="A"
onclick="submi t()"A </td>
<td><input type="radio" name="abbr_lett er" value="B"
onclick="submi t()"B </td>
<td><input type="radio" name="abbr_lett er" value="C"
onclick="submi t()"C </td>
<td><input type="radio" name="abbr_lett er" value="D"
onclick="submi t()"D </td>
<td><input type="radio" name="abbr_lett er" value="E"
onclick="submi t()"E </td>
<td><input type="radio" name="abbr_lett er" value="F"
onclick="submi t()"F </td>
<td><input type="radio" name="abbr_lett er" value="G"
onclick="submi t()"G </td>
<td><input type="radio" name="abbr_lett er" value="H"
onclick="submi t()"H </td>
<td><input type="radio" name="abbr_lett er" value="I"
onclick="submi t()"I </td>
<td><input type="radio" name="abbr_lett er" value="J"
onclick="submi t()"J </td>
<td><input type="radio" name="abbr_lett er" value="K"
onclick="submi t()"K </td>
<td><input type="radio" name="abbr_lett er" value="L"
onclick="submi t()"L </td>
<td><input type="radio" name="abbr_lett er" value="M"
onclick="submi t()"M </td>
</tr>
<tr>
<td><input type="radio" name="abbr_lett er" value="N"
onclick="submi t()"N </td>
<td><input type="radio" name="abbr_lett er" value="O"
onclick="submi t()"O </td>
<td><input type="radio" name="abbr_lett er" value="P"
onclick="submi t()"P </td>
<td><input type="radio" name="abbr_lett er" value="Q"
onclick="submi t()"Q </td>
<td><input type="radio" name="abbr_lett er" value="R"
onclick="submi t()"R </td>
<td><input type="radio" name="abbr_lett er" value="S"
onclick="submi t()"S </td>
<td><input type="radio" name="abbr_lett er" value="T"
onclick="submi t()"T </td>
<td><input type="radio" name="abbr_lett er" value="U"
onclick="submi t()"U </td>
<td><input type="radio" name="abbr_lett er" value="V"
onclick="submi t()"V </td>
<td><input type="radio" name="abbr_lett er" value="W"
onclick="submi t()"W </td>
<td><input type="radio" name="abbr_lett er" value="X"
onclick="submi t()"X </td>
<td><input type="radio" name="abbr_lett er" value="Y"
onclick="submi t()"Y </td>
<td><input type="radio" name="abbr_lett er" value="Z"
onclick="submi t()"Z </td>
</tr>
</TABLE>
<input type="button" onclick="setChe ckedValue('abbr _letter', 'V')"
value="Set Radio Button">
<input type="button" onclick="disp_a lert()" value="Display alert box">
</FORM>
</body>


I rewrote the function and it works. I thought that the old function
should work..

function setCheckedValue (newValue) {
var len = document.author _abbrv.abbr_let ter.length
for(var i = 0; i < len; i++) {
document.author _abbrv.abbr_let ter[i].checked = false;
if(document.aut hor_abbrv.abbr_ letter[i].value ==
newValue.toStr ing()) {
document.author _abbrv.abbr_let ter[i].checked = true;
}
}
}
In the original function, you receive the *name* of the radio
group as the first argument, and try to treat that string
as if it were the Radio object. The name of the thing is not
the thing.
--

Nov 12 '06 #4
Lee wrote:
IchBin said:
>IchBin wrote:
>>I can not see what the problem is with this script. I am just trying to
set a radio button by calling setCheckedValue ('abbr_letter', 'V'). Sorry
I am new to javascript.
<html>
<head>
<script type="text/javascript">
function setCheckedValue (radioObj, newValue) {
if(!radioObj)
return;

var radioLength = radioObj.length ;
if(radioLength == undefined) {
radioObj.checke d = (radioObj.value == newValue.toStri ng());
return;
}
for(var i = 0; i < radioLength; i++) {
radioObj[i].checked = false;
if(radioObj[i].value == newValue.toStri ng()) {
radioObj[i].checked = true;
}
}
}
function disp_alert()
{
alert("I am an alert box!!")
}
</SCRIPT>
</head>
<body>
<b><FORM NAME="author_ab brv" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>"></b>
<table>
<tr>
<td><input type="radio" name="abbr_lett er" value="A"
onclick="subm it()"A </td>
<td><input type="radio" name="abbr_lett er" value="B"
onclick="subm it()"B </td>
<td><input type="radio" name="abbr_lett er" value="C"
onclick="subm it()"C </td>
<td><input type="radio" name="abbr_lett er" value="D"
onclick="subm it()"D </td>
<td><input type="radio" name="abbr_lett er" value="E"
onclick="subm it()"E </td>
<td><input type="radio" name="abbr_lett er" value="F"
onclick="subm it()"F </td>
<td><input type="radio" name="abbr_lett er" value="G"
onclick="subm it()"G </td>
<td><input type="radio" name="abbr_lett er" value="H"
onclick="subm it()"H </td>
<td><input type="radio" name="abbr_lett er" value="I"
onclick="subm it()"I </td>
<td><input type="radio" name="abbr_lett er" value="J"
onclick="subm it()"J </td>
<td><input type="radio" name="abbr_lett er" value="K"
onclick="subm it()"K </td>
<td><input type="radio" name="abbr_lett er" value="L"
onclick="subm it()"L </td>
<td><input type="radio" name="abbr_lett er" value="M"
onclick="subm it()"M </td>
</tr>
<tr>
<td><input type="radio" name="abbr_lett er" value="N"
onclick="subm it()"N </td>
<td><input type="radio" name="abbr_lett er" value="O"
onclick="subm it()"O </td>
<td><input type="radio" name="abbr_lett er" value="P"
onclick="subm it()"P </td>
<td><input type="radio" name="abbr_lett er" value="Q"
onclick="subm it()"Q </td>
<td><input type="radio" name="abbr_lett er" value="R"
onclick="subm it()"R </td>
<td><input type="radio" name="abbr_lett er" value="S"
onclick="subm it()"S </td>
<td><input type="radio" name="abbr_lett er" value="T"
onclick="subm it()"T </td>
<td><input type="radio" name="abbr_lett er" value="U"
onclick="subm it()"U </td>
<td><input type="radio" name="abbr_lett er" value="V"
onclick="subm it()"V </td>
<td><input type="radio" name="abbr_lett er" value="W"
onclick="subm it()"W </td>
<td><input type="radio" name="abbr_lett er" value="X"
onclick="subm it()"X </td>
<td><input type="radio" name="abbr_lett er" value="Y"
onclick="subm it()"Y </td>
<td><input type="radio" name="abbr_lett er" value="Z"
onclick="subm it()"Z </td>
</tr>
</TABLE>
<input type="button" onclick="setChe ckedValue('abbr _letter', 'V')"
value="Set Radio Button">
<input type="button" onclick="disp_a lert()" value="Display alert box">
</FORM>
</body>

I rewrote the function and it works. I thought that the old function
should work..

function setCheckedValue (newValue) {
var len = document.author _abbrv.abbr_let ter.length
for(var i = 0; i < len; i++) {
document.author _abbrv.abbr_let ter[i].checked = false;
if(document.aut hor_abbrv.abbr_ letter[i].value ==
newValue.toStr ing()) {
document.author _abbrv.abbr_let ter[i].checked = true;
}
}
}

In the original function, you receive the *name* of the radio
group as the first argument, and try to treat that string
as if it were the Radio object. The name of the thing is not
the thing.

Thanks... Then how do I pass the reference to that Object to a
Javascript function?

--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
_______________ _______________ _______________ _______________ __________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Nov 12 '06 #5
Evertjan. wrote:
IchBin wrote on 12 nov 2006 in comp.lang.javas cript:
> <b><FORM NAME="author_ab brv" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>"></b>

Dear YouAre,

Why do you make bold an element part the does not display anything?
Sorry I do not understand your question... I am posting the selections
to a php var. from the php var I can pass that to the javascript
function. I just need to have the selected radio button available to php.

In this snip of code I am not using this action. This is why I hard
codded the call to the javascript function.

--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
_______________ _______________ _______________ _______________ __________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Nov 12 '06 #6
IchBin wrote on 12 nov 2006 in comp.lang.javas cript:
Evertjan. wrote:
>IchBin wrote on 12 nov 2006 in comp.lang.javas cript:
>> <b><FORM NAME="author_ab brv" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>"></b>

Dear YouAre,

Why do you make bold an element part the does not display anything?

Sorry I do not understand your question...
The question is simple:

Why do you enclose the <form .. in <b... </b?

I am posting the selections
to a php var. from the php var I can pass that to the javascript
function. I just need to have the selected radio button available to php.

In this snip of code I am not using this action. This is why I hard
codded the call to the javascript function.
Eh?
Why post unused code in your question?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 12 '06 #7
IchBin wrote:
Lee wrote:
>IchBin said:
>>IchBin wrote:
I can not see what the problem is with this script. I am just trying
to set a radio button by calling setCheckedValue ('abbr_letter',
'V'). Sorry I am new to javascript.
<html>
<head>
<script type="text/javascript">
function setCheckedValue (radioObj, newValue) {
if(!radioObj)
return;

var radioLength = radioObj.length ;
if(radioLength == undefined) {
radioObj.checke d = (radioObj.value == newValue.toStri ng());
return;
}
for(var i = 0; i < radioLength; i++) {
radioObj[i].checked = false;
if(radioObj[i].value == newValue.toStri ng()) {
radioObj[i].checked = true;
}
}
}
function disp_alert()
{
alert("I am an alert box!!")
}
</SCRIPT>
</head>
<body>
<b><FORM NAME="author_ab brv" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>"></b>
<table>
<tr>
<td><input type="radio" name="abbr_lett er" value="A"
onclick="sub mit()"A </td>
<td><input type="radio" name="abbr_lett er" value="B"
onclick="sub mit()"B </td>
<td><input type="radio" name="abbr_lett er" value="C"
onclick="sub mit()"C </td>
<td><input type="radio" name="abbr_lett er" value="D"
onclick="sub mit()"D </td>
<td><input type="radio" name="abbr_lett er" value="E"
onclick="sub mit()"E </td>
<td><input type="radio" name="abbr_lett er" value="F"
onclick="sub mit()"F </td>
<td><input type="radio" name="abbr_lett er" value="G"
onclick="sub mit()"G </td>
<td><input type="radio" name="abbr_lett er" value="H"
onclick="sub mit()"H </td>
<td><input type="radio" name="abbr_lett er" value="I"
onclick="sub mit()"I </td>
<td><input type="radio" name="abbr_lett er" value="J"
onclick="sub mit()"J </td>
<td><input type="radio" name="abbr_lett er" value="K"
onclick="sub mit()"K </td>
<td><input type="radio" name="abbr_lett er" value="L"
onclick="sub mit()"L </td>
<td><input type="radio" name="abbr_lett er" value="M"
onclick="sub mit()"M </td>
</tr>
<tr>
<td><input type="radio" name="abbr_lett er" value="N"
onclick="sub mit()"N </td>
<td><input type="radio" name="abbr_lett er" value="O"
onclick="sub mit()"O </td>
<td><input type="radio" name="abbr_lett er" value="P"
onclick="sub mit()"P </td>
<td><input type="radio" name="abbr_lett er" value="Q"
onclick="sub mit()"Q </td>
<td><input type="radio" name="abbr_lett er" value="R"
onclick="sub mit()"R </td>
<td><input type="radio" name="abbr_lett er" value="S"
onclick="sub mit()"S </td>
<td><input type="radio" name="abbr_lett er" value="T"
onclick="sub mit()"T </td>
<td><input type="radio" name="abbr_lett er" value="U"
onclick="sub mit()"U </td>
<td><input type="radio" name="abbr_lett er" value="V"
onclick="sub mit()"V </td>
<td><input type="radio" name="abbr_lett er" value="W"
onclick="sub mit()"W </td>
<td><input type="radio" name="abbr_lett er" value="X"
onclick="sub mit()"X </td>
<td><input type="radio" name="abbr_lett er" value="Y"
onclick="sub mit()"Y </td>
<td><input type="radio" name="abbr_lett er" value="Z"
onclick="sub mit()"Z </td>
</tr>
</TABLE>
<input type="button" onclick="setChe ckedValue('abbr _letter',
'V')" value="Set Radio Button">
<input type="button" onclick="disp_a lert()" value="Display alert
box">
</FORM>
</body>
I rewrote the function and it works. I thought that the old function
should work..

function setCheckedValue (newValue) {
var len = document.author _abbrv.abbr_let ter.length
for(var i = 0; i < len; i++) {
document.author _abbrv.abbr_let ter[i].checked = false;
if(document.aut hor_abbrv.abbr_ letter[i].value ==
newValue.toSt ring()) {
document.author _abbrv.abbr_let ter[i].checked = true;
}
}
}

In the original function, you receive the *name* of the radio
group as the first argument, and try to treat that string
as if it were the Radio object. The name of the thing is not
the thing.
Thanks... Then how do I pass the reference to that Object to a
Javascript function?
Thanks anyway... I found it:

setCheckedValue (document.autho r_abbrv.element s['abbr_letter'], 'S');

--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
_______________ _______________ _______________ _______________ __________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Nov 12 '06 #8
Evertjan. wrote:
IchBin wrote on 12 nov 2006 in comp.lang.javas cript:
>Evertjan. wrote:
>>IchBin wrote on 12 nov 2006 in comp.lang.javas cript:

<b><FORM NAME="author_ab brv" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>"></b>

Dear YouAre,

Why do you make bold an element part the does not display anything?
Sorry I do not understand your question...

The question is simple:

Why do you enclose the <form .. in <b... </b?

>I am posting the selections
to a php var. from the php var I can pass that to the javascript
function. I just need to have the selected radio button available to php.

In this snip of code I am not using this action. This is why I hard
codded the call to the javascript function.

Eh?
Why post unused code in your question?

Because it is really a php script and I missed it when I was stripping
it out to post an example! I am new to javascript/php and not
programming. Turns out it was a call from php that should resolve the
problem.

echo 'setCheckedValu e("abbr_letter" , "'.$_SESSIO N['abbr_letter'].'")';

--
Thanks in Advance... http://ichbin.9999mb.com
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
_______________ _______________ _______________ _______________ __________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Nov 12 '06 #9
IchBin wrote on 12 nov 2006 in comp.lang.javas cript:
Evertjan. wrote:
>IchBin wrote on 12 nov 2006 in comp.lang.javas cript:
>>Evertjan. wrote:
IchBin wrote on 12 nov 2006 in comp.lang.javas cript:

<b><FORM NAME="author_ab brv" method="POST" action="<?php echo
$_SERVER['PHP_SELF'];?>"></b>
>
Dear YouAre,

Why do you make bold an element part the does not display anything?

Sorry I do not understand your question...

The question is simple:

Why do you enclose the <form .. in <b... </b?
And this?
>>I am posting the selections
to a php var. from the php var I can pass that to the javascript
function. I just need to have the selected radio button available to
php.

In this snip of code I am not using this action. This is why I hard
codded the call to the javascript function.

Eh?
Why post unused code in your question?

Because it is really a php script and I missed it when I was stripping
it out to post an example! I am new to javascript/php and not
programming. Turns out it was a call from php that should resolve the
problem.

echo 'setCheckedValu e("abbr_letter" ,
"'.$_SESSIO N['abbr_letter'].'")';


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 12 '06 #10

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

Similar topics

4
3281
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:
5
3108
by: Digital Puer | last post by:
I have the following HTML form: - radio button A (default selected) - radio button B - input field, of type "file" with "Choose" button - submit button I would like to have it so that if the user clicks on the "Choose" button of the input field (to select a file on the local disk), then radio button B is automatically
3
3133
by: John Davis | last post by:
I created a ASP.NET Web Form using VB.NET with a text box, 2 radio buttons. When the user click the first radio button, the text will change to uppercase. If the user clicks the other radio button, the text will change to lowercase. I added the following event, but still won't able to change the text to uppercase. Private Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles...
3
2074
by: Amelyan | last post by:
When we want radio button to belong to a group name we say, radio1.GroupName="GroupA". In this case, radio1 will be unselected if another radio button is selected in "GroupA". Is there a way (trick, custom RadioButton, or javascript) to make radio button (radio1) belong to 2 independent radio button groups instead of one? This would be an equivalent of sayting something like radio1.GroupName1 = "GroupA"; radio1.GroupName2 = "GroupB";
8
5904
by: David Cameron | last post by:
I noticed that using an HTMLInputRadioButton and specifying a value to be an empty string (""), this is overridden by ASP.Net which set the value of the control to be the same as the ID of the control. See the code below * Page.aspx: <%@ Page language="c#" Codebehind="Test.aspx.cs" AutoEventWireup="false" Inherits="Webspace.Test" %>
10
6104
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio button with this link of code: echo 'SCRIPT language=JavaScript setCheckedValue("'.$_SESSION.'");</SCRIPT>'; //? <snip of code>
1
1851
by: thirunavukarasukm | last post by:
I have a link wich opens a the second page with links wich call a javascript function. I have some problem with javascript. i am two aspx page.. in my first aspx page contain the second aspx page name.. i am clicking the second page link the second page is opened..
11
2030
by: nitha | last post by:
hi there...i need help... just wondering how to put a function? this is the form: <form> <p>Room type:<br/> <input type="radio" id="room1" name="room" onclick="roomCost=150" value="150"/><label for="garden">Garden</label><br/> <input type="radio" id="room2" name="room" onclick="roomCost=200" value="200"/><label for="hillside">Hillside</label><br/> <input type="radio" id="room3" name="room" onclick="roomCost=250"...
8
4615
by: photoboy | last post by:
I have racked by brain long enough on this, so now I need the help of someone who knows what they are doing. Here is what I am trying to achieve: First, I have two radio buttons (both unchecked) that need to be validated when the submit button is clicked. Instead of the standard alert window popping up (which I have now), I want the radio button background color to change from the table color (E2E2E2) to red (FF0000) for both buttons...
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9416
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9849
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
8861
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...
0
6661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5433
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3551
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2810
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.