473,503 Members | 2,435 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Button - help

Hi.

I have problem with Button and I don't know what is wrong. Could somebody
help me??
Thanks ;)

html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=ISO-8859-2">
<title>Formularz</title>
<script language="JavaScript"><!-- HIDE FROM OTHER BROWSERS

function fncOblicz()
{
with (Math)
{
var DD=document.Twoj.Dzien.value;
var MM=document.Twoj.Miesiac.value;
if ((DD>=1) && (MM=8) || (DD<=21) && (MM=8))
{HH=10}
else
if ((DD>=22) && (MM=8) || (DD<=31) && (MM=8))
{HH=11}
else
HH=false
}
}
// STOP HIDING FROM OTHER BROWSERS -->
</script>
</head>
<body>
<div align="Center">
<h1><i>Twój Horoskop</i></h1>
<hr width="40%">
<form name="Twoj">
<b>Dzień</b>
<input type="TEXT" name="Dzien" value="" size=3 maxlength=6 >
<br>
<br><b>Miesiac</b>
<input type="TEXT" name="Miesiac" value="" size=3 maxlength=6>
<br>
<form>
<INPUT TYPE="button" VALUE="Oblicz" onClick="fncOblicz();" ><br>
</form>
<b>Horoskop</b>
<input type="TEXT" name="Horoskop" value="" size=3 maxlength=6>
</form>
</div><b>
</body>
</html>

Jan 3 '07 #1
8 1113
Marzena wrote on 03 jan 2007 in comp.lang.javascript:
Hi.

I have problem with Button and I don't know what is wrong. Could
somebody help me??
Thanks ;)

html>
<head>
<meta http-equiv="Content-type"
content="text/html;charset=ISO-8859-2"<title>Formularz</title>
<script language="JavaScript">
use instead:

<script type='text/javascript'>
<!-- HIDE FROM OTHER BROWSERS
do not use that line above,
it only is necessary for browsers more than 10 yars old.

function fncOblicz()
see below
{
with (Math)
Where do you use Marth in the below code?

Nowhere, so leave it out

{
var DD=document.Twoj.Dzien.value;
var MM=document.Twoj.Miesiac.value;
if ((DD>=1) && (MM=8) || (DD<=21) && (MM=8))
{HH=10}
else
if ((DD>=22) && (MM=8) || (DD<=31) && (MM=8))
{HH=11}
else
HH=false
It is unclear what you want to do with the value of HH.
So what is your problem?

}
}
// STOP HIDING FROM OTHER BROWSERS -->
Do not use this line above
</script>
</head>
<body>
<div align="Center">
<h1><i>Twój Horoskop</i></h1>
<hr width="40%">
<form name="Twoj">
<b>Dzień</b>
<input type="TEXT" name="Dzien" value="" size=3 maxlength=6 >
<br>
<br><b>Miesiac</b>
<input type="TEXT" name="Miesiac" value="" size=3 maxlength=6>
<br>
<form>
You cannot use <forminside a <form>,
and expect the two to work as one <form>
Leave this <formout.
<INPUT TYPE="button" VALUE="Oblicz" onClick="fncOblicz();"
Better use:

<INPUT TYPE="submit" VALUE="Oblicz">

and in the top of the form

<form onsubmit="fncOblicz(this);return false;">

and in the function:

function fncOblicz(f) {
var DD = f.elements['Dzien'].value;
.....
><br>
</form>
Leave this </formout
<b>Horoskop</b>
<input type="TEXT" name="Horoskop" value="" size=3 maxlength=6>
</form>
</div><b>
<b>? why?
</body>
</html>



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 3 '07 #2
Hi!!

Thanks for all. I want here that if someone write in
Dzien=3 and Miesiac=8 then click "Oblicz" and in Horoskop=10
or Dzien=25 and Miesiac=8 then click "Oblicz" and in Horoskop=11

I hope you understand what I want to say
Marzena
Jan 3 '07 #3
Marzena wrote on 03 jan 2007 in comp.lang.javascript:
Thanks for all. I want here that if someone write in
Dzien=3 and Miesiac=8 then click "Oblicz" and in Horoskop=10
or Dzien=25 and Miesiac=8 then click "Oblicz" and in Horoskop=11

I hope you understand what I want to say
No I don't really understand.

I guess you mean this, try it:

============ test.html =========

<script type='text/javascript'>

function fncOblicz(f) {
var DD = +f.elements['Dzien'].value;
var MM = +f.elements['Miesiac'].value;
var HH = f.elements['Horoskop'];
if ( ((DD>=1) || (DD<=21)) && (MM==8) ) {
HH.value = '10';
} else if ( ((DD>=22) || (DD<=31)) && (MM==8) ) {
HH.value = '11';
} else {
HH.value = '';
};
return false;
};

</script>

<form onsubmit='return fncOblicz(this);'>
<b>Dzień:</b>
<input type='TEXT' name='Dzien'>
<br><br>
<b>Miesiac:</b>
<input type='TEXT' name='Miesiac'>
<br><br>
<input type='submit' value='Oblicz'>
<br><br>
<b>Horoskop:</b>
<input type='TEXT' name='Horoskop' readonly>
</form>

================================

compare is not MM=8 but MM==8

+f.elements['Dzien'].value

the + is necessary if you wanrt to compase numbers,
not strings like '08'=='8'

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 3 '07 #4
Hi!!

Yes, that's exactly what I want. Thank you very much for your help. You are
really nice ;)

Marzena
Jan 3 '07 #5
Marzena wrote on 03 jan 2007 in comp.lang.javascript:
Yes, that's exactly what I want. Thank you very much for your help.
You are really nice ;)
Eh???

Please, this is not email.

Othere and I are wondering where you are responding on.

On usenet following netiquestte, you should always quote what you are
responding on.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 3 '07 #6

"Evertjan." wrote on 03 jan 2007 in comp.lang.javascritp:
Eh???

Please, this is not email.
Sorry
Othere and I are wondering where you are responding on.
Do you mind, where I live??
On usenet following netiquestte, you should always quote what you are
responding on.
Sorry, I'll remember ;)

Marzena
Jan 3 '07 #7
Marzena wrote on 03 jan 2007 in comp.lang.javascript:
>Othere and I are wondering where you are responding on.

Do you mind, where I live??
That is "responding from".

"responding on" points to the [hidden] subject of your response.

;-}

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 3 '07 #8

Evertjan wrote on 03 jan 2007 in comp.lang.javascript:
>>Othere and I are wondering where you are responding on.

Do you mind, where I live??

That is "responding from".

"responding on" points to the [hidden] subject of your response.
Ok thanks ;)

Marzena
Jan 4 '07 #9

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

Similar topics

5
2261
by: TrvlOrm | last post by:
Can any one please help me...I am new to JavaScript and I have been struggling with this code for days now and can't figure it out. I would like to get the Buttons to correspond with the action...
6
12793
by: Sujan | last post by:
Hello all, Help me! -------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <script language="JavaScript"> <!--
7
2564
by: MgGuigg | last post by:
Hello all, This is my first time posting a question to this forum, so here is hoping I am following protocol. I am scraping the rust off my old Basic programming skills, and have just recently...
3
13724
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
0
1852
by: David | last post by:
Hello all. I am trying to implement my first server control and have run into two problems that I cannot solve. I need the assistance of someone with more experience. My goal was to create an...
3
1978
by: Kannan | last post by:
Hi, I am trying to created Outloook Add-in Com in outlook using C#. I have seen this URL for developing this sample http://support.microsoft.com/?kbid=302901 When I executed this program it...
8
2008
by: Richard Maher | last post by:
Hi, I am in a mouseup event for button A and I'd like to disable=false button B before starting some work. Is there anyway that an event for button B can then fire before my event processing for...
4
3661
by: glbdev | last post by:
Hi, I posted this question yesterday but didn't get the answer I needed. I am DESPERATE to get this working so I'm re-posting it because I don't think I worded it correctly. I have a GridView...
3
1799
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hi all, i betcha here's a question never asked before ;) i have a simple web form with a gridview and a button. the button doesn't do anything but a postback. i load up the gridview from the...
23
19067
by: shashi shekhar singh | last post by:
Dear sir, I have a word document file contains text and images, now i have saved it as a web page and wants to display it on browser , using , string str=directory.getfiles("");...
0
7188
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,...
0
7063
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...
0
7258
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,...
1
6970
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5558
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,...
1
4987
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...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
366
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...

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.