I have a method that I use for Javascript validation (see below). What
I want to do is change the alert title, buttons, icon etc. Does anybody
know the correct syntax to do this?
private void Gen_Alert(strin g Key, string msg)
{
string str = "";
str += "<script language='javas cript'>";
str += "alert('"+msg+" ')";
str += "</script>";
RegisterStartup Script(Key, str);
}
Cheers,
Mike
*** Sent via Developersdex http://www.developersdex.com *** 3 1731
You can't. There are several pre-defined functions in JavaScript that do
similar things. The alert() function simply pops up a MessageBox with an OK
button on it. The confirm() function pops up a MessageBox with an OK and
Cancel button, and returns true if OK is clicked, and false if Cancel is
clicked. The propmt() function pops up a MessageBox with a text box and an
OK button, and returns the string entered into the text box.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
"Mike P" <mi*******@gmai l.com> wrote in message
news:uf******** ******@TK2MSFTN GP14.phx.gbl... I have a method that I use for Javascript validation (see below). What I want to do is change the alert title, buttons, icon etc. Does anybody know the correct syntax to do this?
private void Gen_Alert(strin g Key, string msg) { string str = ""; str += "<script language='javas cript'>"; str += "alert('"+msg+" ')"; str += "</script>"; RegisterStartup Script(Key, str); }
Cheers,
Mike *** Sent via Developersdex http://www.developersdex.com ***
Kevin,
Thanks for the info about confirm() and prompt(), they may come in
useful!
Cheers,
Mike
*** Sent via Developersdex http://www.developersdex.com ***
You're quite welcome, Mike. I probably should have mentioned another, more
difficult alternative, which is to design a popup that does whatever you
need. It is more difficult because, for example, many browsers don't allow
popups. This can be overcome, however, by the use of an
absolutely-positioned div with a zIndex higher than the rest of the page.
Making it look like a dialog box is somewhat problematic, and unlike a
regular popup, its position is nailed to the position of the window below
it. It also requires a good bit of DHTML (JavaScript/HTML/CSS) programming
to use it, but if you design it well, it can be re-used in the same (and
other) web applications. The greatest difficulty with this sort of solution
is making it look and behave more or less the same in all browsers. But it
can certainly be done.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
"Mike P" <mi*******@gmai l.com> wrote in message
news:OL******** ********@TK2MSF TNGP15.phx.gbl. .. Kevin,
Thanks for the info about confirm() and prompt(), they may come in useful!
Cheers,
Mike
*** Sent via Developersdex http://www.developersdex.com *** This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Sue |
last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided
to improve character checking on my project. In my project I only had
to do very basic validation. Therefore, I only had one function to
verify the name fields, age, email and gender.
My question is: if I create a function for each field like the code
below, what would be the best way to organize the functions and call
them? Would I need one main function and place...
|
by: tzigone |
last post by:
hello,
i use asp.net validation controls in my site. i wonder whether usin
javascript validation will fasten page load speed?
there are currently lots of requiredfieldvalidator now is it better t
use 1 javascript instead of these validators
tzigon
-----------------------------------------------------------------------
Posted via http://www.forum4designers.co
-----------------------------------------------------------------------
|
by: Retlak |
last post by:
The recommended (on dozens of websites) and effective (works in
Netscape, MSIE, Mozilla, probably others) way to detect if a browser
has Javascript turned off is to put this in the <head>:
<noscript>
<meta http-equiv="refresh"
content="1;url=http://yourURL/nojscript.html">
</noscript>
This redirects to a doc which typically says "You need to enable
|
by: GIMME |
last post by:
Background ...
I've created a web application that allows a user to create an
HTML application from IE.
The application itself creates an XML representation of a XHTML
form. The XHTML representation can be saved as a string and recreated.
(The application also has a crude workflow aspect - so XMHTML forms
can be created and assigned a workflow. Forget I said anything about
|
by: Allan M. |
last post by:
I have a series of select boxes that must be populated
client side, because they interact with each other. The
design specification calls for these boxes to be updated
without having to make a roundtrip to the server.
The codebehind seems to be unaware of select box members
populated via javascript. So, I'm having to create my own
state management solution, (i.e. rewriting the VIEWSTATE
mechanism) to persist the state of these select...
| |
by: |
last post by:
Hi all,
Has anyone been able to write some custom javascript on the onclick event of
submit button to do certain things like disable submit button, only submit
form once etc. This was a breeze in 1.1 since I could edit the .js file. Now
in 2.0 I can no longer do this. Also, my code would have to be called after
all client-side validation was done and was successful. Any ideas?
TIA!
|
by: chrisdude911 |
last post by:
how do i add video into a javascript web page with my own custom
buttons?
|
by: Chris |
last post by:
Hi,
I have a form for uploading documents and inserting the data into a mysql
db. I would like to validate the form. I have tried a couple of Javascript
form validation functions, but it appears that the data goes straight to the
processing page, rather than the javascript seeing if data is missing and
popping up an alert. I thought it may be because much of the form is
populated with data from the db (lists, etc.), but when I leave...
|
by: Peter Afonin |
last post by:
Hello,
I'm creating an application in ASP.NET 1.1. I need to check whether at least
one checkbox in my datagrid has been checked. To do this, I'm using
Javascript - I'm adding this code to Page_Load event:
Dim iCount As Int32
Dim sClientSideValidate As New StringBuilder
iCount = dgReport.Items.Count
For i As Int32 = 2 To iCount + 1
|
by: Peter Afonin |
last post by:
Hello,
I'm not an expert in Javascript, so I'm seeking an advice.
As I mentioned in my previous post, I use Javascript to check whether at
least one checkbox in the datagrid has been checked. I have to use
Stringbuilder to do this:
Dim iCount As Int32
Dim sClientSideValidate As New StringBuilder
|
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,...
| |
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...
|
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...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |