PDA

Click to See Complete Forum and Search --> : message box... check date/time


tmashley
Jan 21st, 2003, 08:25 AM
Hi all,
as you can't display a message box using vb.net, i have had to use javascript...

i am using a Popup Calendar that sent the value of text boxes to the dates selected
i need to make sure that the end date is after the start date.

this is what i am doing at the moment...

function CheckTime(){
if (document.CRC.txtStartDate.value >= document.CRC.txtEndDate.value){
var ErrMsg = "End Date Must be later than Start Date";
alert(ErrMsg);
return false;
}
}

the problem is; example
StartDate = 23/12/2003
EndDate = 13/11/2003

the code thinks that beacuse the first number is greater, then the whole number is, so it doesn't work.

please help.
Thanks
Tom

RealNickyDude
Jan 21st, 2003, 10:34 AM
as you can't display a message box using vb.net, i have had to use javascriptI'm not sure i'm with you here because you can display a message box in vb .net:

MessageBox.Show("Here is a message!")I'm not sure about the dates though.

tmashley
Jan 23rd, 2003, 03:40 AM
MessageBox.Show("Here is a message!")

this is not declared! ??

p.s. i am using web application so system.windows.forms doesn't work, is there a function within web applications?

james14
Jan 23rd, 2003, 02:28 PM
well for my game i would use
Private sub button1_click (....)
msgbox("Hey, insert your message here")
Thats how you show a msg box but with the calender thing i have to get on my other comp to check

tmashley
Jan 24th, 2003, 03:01 AM
ok, that might work, but i am getting this error:

It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

my project is a web application, if that makes any different

Edneeis
Jan 24th, 2003, 03:26 AM
ASP.NET can't show messageboxes you'll need to use some java code in there to do that. Also ASP.NET runs server side so if it could show a messagebox it'd end up on the server not the client.

tmashley
Jan 24th, 2003, 03:29 AM
thanks :)
just found that out ;)

Ooogaleee
Jan 24th, 2003, 02:47 PM
Yep, no message boxes on ASP pages unfortunately. I usually put a well-placed label control on the page with the bgcolor the same as the page itself. That way if I need to use it, it's there, if not, it's invisible.

For whatever it's worth...