Daniel
Wed Jul 21 09:01:37 CDT 2004
Hello:
since you may have the solution to my problem i would like to ask you
something, is there any problem to use
<SCRIPT LANGUAGE="VBScript"> and <SCRIPT LANGUAGE="javascript"> in the smae
page?
i am having a trouble and i suspect that maybe is this.
in a page where i use both i try the following script and it gives me an
error saying Object doesn't support this property or method when i try to
call MiFuncion
<SCRIPT LANGUAGE="VBScript">
<!--
Sub MiFuncion()
Dim Inicio
DIM Dias
Inicio = #07/01/2004#
form1.startdate.value = Inicio
dias = int(form1.horas.value) / int("8")
form1.final.value = inicio + int(dias)
End Sub
-->
</SCRIPT>
i call it like this:
<input name="final" type="Text" id="final" onFocus="Mifuncion">
When i try this in a page with only this script, it works fine
when i add it to the page where it goes, where there is other javascripts
also, it tells me that error.
Thanks for your help.
Daniel
"Dr John Stockton" <spam@merlyn.demon.co.uk> wrote in message
news:QbJIKsFy7D$AFwRi@merlyn.demon.co.uk...
JRS: In article <5iSKc.5930$Vw3.541534@news20.bellglobal.com>, dated
Mon, 19 Jul 2004 12:04:18, seen in news:microsoft.public.scripting.vbscr
ipt, Rizwan <hussains@pendylum.com> posted :
>I need to build a string for current date and time in this format :
>YYYYMMDDHHMMSS. So I wrote this code :
>
>Dim v_CurrentDate
>Dim v_DateString
>
>v_CurrentDate = Date
>DateString = DatePart ( "yyyy", v_CurrentDate ) & _
> Right ( "0" & DatePart ("m", v_CurrentDate), 2 ) &
_
> Right ( "0" & DatePart ("d", v_CurrentDate), 2 ) &
_
> Right ( "0" & DatePart ("h", v_CurrentDate), 2 ) &
_
> Right ( "0" & DatePart ("n", v_CurrentDate), 2 ) &
_
> Right ( "0" & DatePart ("s", v_CurrentDate), 2 )
>
>But the above code is only working correctly for year, month and day part
>but not the hours, month and seconds. The result I am getting is :
>
>DateString = 20040719000000
>
>My question is why hours, month and seconds are being returned as 000000?
>What mistake I am making here?
You should have used Now.
AFAICS, the only advantage of using DatePart instead of Year, etc. is
that the code lines up so neatly.
The following approach is shorter :-
GNow = Now
DateString = _
CStr( ((((Year(GNow)*100 + Month(GNow))*100 + Day(GNow))*100 _
+ Hour(GNow))*100 + Minute(GNow))*100 + Second(GNow) )
document.write DateString
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
©
<URL:
http://jibbering.com/faq/> JL / RC : FAQ for
news:comp.lang.javascript
<URL:
http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates,
sources.
<URL:
http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items,
links.