Please help me explain the OPPs syntax for the radiobutton and jav

F

Frank H. Shaw

Thank you for clear up the fact that HTML is a markup and not code I have
created the Logic for what I need I know that the IF ELSE ENDIF will work
because of my years of programing behind me but what I am trying to do is get
the correct syntax for the conditional exprision which is the following:
(amount[1].checked) I beleaive I could also do the
following:(amount[1].value = 20.95) that should work also but would I have to
put "20.95" or '20.95' and what would I have if any before the amount[1]
which I assume means the first radiobutton - Please explain to me proper Opps
syntaxs and how I figure it out in the herararcy I place the exact HTMLmarkup
for the radiobuttons at the bottom of this message. Once I get a understand
of how it is done for the radiobutton I can figure it out for any object
because it is all done the same. Please use my example so I can follow it
also is what I need to do on my actual web page and I need to do it the way I
constucted the question in my first thread. which I posted below again THANKS
Please look at the condional expersion (amount[1].checked) is
it correct written and acrurate does it do the following:

Will the conditional expersion in the if statement do the
following: If the the first radiobutton named amount in the
amount radiobutton group of two radiobuttons at the bottom of
this message is checked then the 2 lines of HTML code before
the else gets excuted if the second radio button is checked
then the 2 lines of HTML code after the ELSE get excuted. The
actual radiobutton HTML code is at the bottom of this message
for you to glance at THANKS
Note: I know the hidden fields do not print and I realize that to test the
HTML markup and javascript I will have to put print statements on both side
of the the ELSE statement.
<Script>

IF (amount[1].checked)

<input type="hidden" name="item_number" value="212-E"> <input
type="hidden" name="amount" value="20.95">
ELSE

<input type="hidden" name="item_number" value="212-D"> <input
type="hidden" name="amount" value="225.00">
ENDIF


<input TYPE="radio" CHECKED NAME="amount"
VALUE="20.95"> said:
style="font-size: 10.0pt; font-family: Trebuchet MS">By
each</span></p>

<input TYPE="radio" NAME="amount" VALUE="225.00"></span><span
style="font-size: 10.0pt; font-family: Trebuchet MS">By
Dozen</span></p>
 
J

Jens Peter Karlsen[FP-MVP]

See inline:
Thank you for clear up the fact that HTML is a markup and not code I have
created the Logic for what I need I know that the IF ELSE ENDIF will work
because of my years of programing behind me but what I am trying to do is get
the correct syntax for the conditional exprision which is the following:
(amount[1].checked) I beleaive I could also do the

if(document.forms[0]amount[1].checked)
that is the correct way to check if the second radiobutton in the first
Form on the page (with the name amount) is checked. Use amount[0] to
adress the first radiobutton.
following:(amount[1].value = 20.95) that should work also but would I have to
put "20.95" or '20.95' and what would I have if any before the amount[1]

If you want to check the value of a textfield you could do it almost
like that. "" or '' would be required.
which I assume means the first radiobutton - Please explain to me proper Opps

A radiobutton can only have one value. Checked. So the above would be
invalid as it can't contain the value 20.95.
syntaxs and how I figure it out in the herararcy I place the exact HTMLmarkup
for the radiobuttons at the bottom of this message. Once I get a understand
of how it is done for the radiobutton I can figure it out for any object
because it is all done the same. Please use my example so I can follow it
also is what I need to do on my actual web page and I need to do it the way I
constucted the question in my first thread. which I posted below again THANKS

Please look at the condional expersion (amount[1].checked) is
it correct written and acrurate does it do the following:

Will the conditional expersion in the if statement do the
following: If the the first radiobutton named amount in the
amount radiobutton group of two radiobuttons at the bottom of
this message is checked then the 2 lines of HTML code before
the else gets excuted if the second radio button is checked
then the 2 lines of HTML code after the ELSE get excuted. The
actual radiobutton HTML code is at the bottom of this message
for you to glance at THANKS

Note: I know the hidden fields do not print and I realize that to test the
HTML markup and javascript I will have to put print statements on both side
of the the ELSE statement.

<Script>

IF (amount[1].checked)

The if is correct. However, you don't tell the script to do anything

Having html here is invalid.

You have an else here, but again you don't tell the script what it
should do.

Having html here is invalid.

endif doesn't exist in javascript.

Please don't take this the wrong way but I strongly suggest that you
start with a tutorial in JavaScript before you go any further. You
obviously have very limited understanding of programming in general and
none of Javascript.
Try this JavaScript tutorial:

http://www.echoecho.com/javascript.htm
 
F

Frank H. Shaw

See inline: FRANKS
Thank you for clear up the fact that HTML is a markup and not code I have
created the Logic for what I need I know that the IF ELSE ENDIF will work
because of my years of programing behind me but what I am trying to do is get
the correct syntax for the conditional exprision which is the following:
(amount[1].checked) I beleaive I could also do the

if(document.forms[0]amount[1].checked) - THANKS FOR CLEARING THAT UP FOR
ME

THE document.form IF RADIOBUTTON IS SETTING IN FORM BUT IN MY CASE IT IS A
CELL IN A TABLE SO WHAT WOULD THAT LOOK LIKE?

that is the correct way to check if the second radiobutton in the first
Form on the page (with the name amount) is checked. Use amount[0] to
adress the first radiobutton.
following:(amount[1].value = 20.95) that should work also but would I have to
put "20.95" or '20.95' and what would I have if any before the amount[1]

If you want to check the value of a textfield you could do it almost
like that. "" or '' would be required.

GOOD THEN i WOULD NEED TO STRING COMPRISON MATCH ON THE TEXT FIELD
which I assume means the first radiobutton - Please explain to me proper Opps

A radiobutton can only have one value. Checked. So the above would be
invalid as it can't contain the value 20.95.

BUT I COULD DO THE FOLOWING THEN;(amount[0].textfield = '20.95')
OR WOULD IT BE (amount[0].value = '20.95') BECAUSE THE " " OR ' ' TELL THAT
IT IS TO BE THE textfield UNSTEAD OF actual value?
syntaxs and how I figure it out in the herararcy I place the exact HTMLmarkup
for the radiobuttons at the bottom of this message. Once I get a understand
of how it is done for the radiobutton I can figure it out for any object
because it is all done the same. Please use my example so I can follow it
also is what I need to do on my actual web page and I need to do it the way I
constucted the question in my first thread. which I posted below again THANKS

Please look at the condional expersion (amount[1].checked) is
it correct written and acrurate does it do the following:

Will the conditional expersion in the if statement do the
following: If the the first radiobutton named amount in the
amount radiobutton group of two radiobuttons at the bottom of
this message is checked then the 2 lines of HTML code before
the else gets excuted if the second radio button is checked
then the 2 lines of HTML code after the ELSE get excuted. The
actual radiobutton HTML code is at the bottom of this message
for you to glance at THANKS

Note: I know the hidden fields do not print and I realize that to test the
HTML markup and javascript I will have to put print statements on both side
of the the ELSE statement.

<Script>

IF (amount[1].checked)

The if is correct. However, you don't tell the script to do anything

Having html here is invalid.

IT IS MY UNDERSTANDING THAT THE HTML AND JAVASCRIPT CAN BE INTERMIXED IS THE
PROBLEM THEIR CAN ONLY BE ONE LINE OF HTML IF SO THEN HOW TO MAKE MORE THEN
ONE LINE OF HTML IF JAVASCRIPT AND HTML CAN NOT BE INTERMEIXED IN THE SAME
THEN MY WAY OF THINKING ABOUT HANDEL THIS HAS TO BE RE THOUGHT BECAUSE FOR
THIS TO WORK I NEED TO HAVE THE TWO INTERMIXED SOME HOW?


You have an else here, but again you don't tell the script what it
should do.

Having html here is invalid.
IT IS MY UNDERSTANDING THAT THE HTML AND JAVASCRIPT CAN BE INTERMIXED IS THE
PROBLEM THEIR CAN ONLY BE ONE LINE OF HTML IF SO THEN HOW TO MAKE MORE THEN
ONE LINE OF HTML IF JAVASCRIPT AND HTML CAN NOT BE INTERMEIXED IN THE SAME
THEN MY WAY OF THINKING ABOUT HANDEL THIS HAS TO BE RE THOUGHT BECAUSE FOR
THIS TO WORK I NEED TO HAVE THE TWO INTERMIXED SOME HOW?

endif doesn't exist in javascript.

HOW DOES THE IF STATEMENT TERMINATE ALL LANGUAGES I HAVE EVER DEALT WITH
SUPPORT THE ENDIF CONSTRUCT IT WAS MY STUPTIY THINK JAVESCRIPT WOULD ALLSO
SORRY ABOUT MY OVERSITE ON THAT

Please don't take this the wrong way but I strongly suggest that you
start with a tutorial in JavaScript before you go any further. You
obviously have very limited understanding of programming in general and
none of Javascript.
Try this JavaScript tutorial:

http://www.echoecho.com/javascript.htm

THANK YOU FOR THE LINK I WILL BE CHECKING IT OUT - I AM LEARN JAVASCRIPT AND
I AM NEW TO THIS TYPE OF PROGRAM AS WELL AS HTMLTHANK YOU FOR CLEARING SOME
OF THE DETAILS WITH ME!

Did this post

:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top