473,386 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using an alert on page load.

UJ
After poking around on the web I found a way to put up a messagebox on page
load to that after I've done something, I can tell the user I've done it.
The method is to have a hidden textbox that I then check the value of in a
function during page load. The problem is that if I make the textbox hidden,
the routine can't find it. If it's visible, it works just fine. I've also
tried a label and had the same results.

Anybody have any thoughts?

TIA

Here's the code:

The code in the head section:
<script language="JavaScript">
function disp_confirm()
{
var txtAD
var txt

txtAD = document.getElementById('lblDisplayMessage')
txtAD.value
if (txt != '')
{
var name=confirm(txt)
}
}
</script>
The code for the text box:
<asp:TextBox id="lblDisplayMessage"
Runat="server">test</asp:TextBox>
Nov 19 '05 #1
3 1549
There is a special control for passing hidden text:

<input type="hidden" runate="server" id="myHiddenText>

In the code-behind it will make an instance of
System.Web.UI.HtmlControls.HtmlInputHidden class.

Eliyahu

"UJ" <fr**@nowhere.com> wrote in message
news:e$**************@TK2MSFTNGP15.phx.gbl...
After poking around on the web I found a way to put up a messagebox on page load to that after I've done something, I can tell the user I've done it.
The method is to have a hidden textbox that I then check the value of in a
function during page load. The problem is that if I make the textbox hidden, the routine can't find it. If it's visible, it works just fine. I've also
tried a label and had the same results.

Anybody have any thoughts?

TIA

Here's the code:

The code in the head section:
<script language="JavaScript">
function disp_confirm()
{
var txtAD
var txt

txtAD = document.getElementById('lblDisplayMessage')
txtAD.value
if (txt != '')
{
var name=confirm(txt)
}
}
</script>
The code for the text box:
<asp:TextBox id="lblDisplayMessage"
Runat="server">test</asp:TextBox>

Nov 19 '05 #2
UJ
Thanks Eliyahu. That did it - It finally works.

J.

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:OZ**************@TK2MSFTNGP15.phx.gbl...
There is a special control for passing hidden text:

<input type="hidden" runate="server" id="myHiddenText>

In the code-behind it will make an instance of
System.Web.UI.HtmlControls.HtmlInputHidden class.

Eliyahu

"UJ" <fr**@nowhere.com> wrote in message
news:e$**************@TK2MSFTNGP15.phx.gbl...
After poking around on the web I found a way to put up a messagebox on

page
load to that after I've done something, I can tell the user I've done it.
The method is to have a hidden textbox that I then check the value of in
a
function during page load. The problem is that if I make the textbox

hidden,
the routine can't find it. If it's visible, it works just fine. I've also
tried a label and had the same results.

Anybody have any thoughts?

TIA

Here's the code:

The code in the head section:
<script language="JavaScript">
function disp_confirm()
{
var txtAD
var txt

txtAD = document.getElementById('lblDisplayMessage')
txtAD.value
if (txt != '')
{
var name=confirm(txt)
}
}
</script>
The code for the text box:
<asp:TextBox id="lblDisplayMessage"
Runat="server">test</asp:TextBox>


Nov 19 '05 #3
UJ
Thanks Eliyahu. That did it - It finally works.

J.

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:OZ**************@TK2MSFTNGP15.phx.gbl...
There is a special control for passing hidden text:

<input type="hidden" runate="server" id="myHiddenText>

In the code-behind it will make an instance of
System.Web.UI.HtmlControls.HtmlInputHidden class.

Eliyahu

"UJ" <fr**@nowhere.com> wrote in message
news:e$**************@TK2MSFTNGP15.phx.gbl...
After poking around on the web I found a way to put up a messagebox on

page
load to that after I've done something, I can tell the user I've done it.
The method is to have a hidden textbox that I then check the value of in
a
function during page load. The problem is that if I make the textbox

hidden,
the routine can't find it. If it's visible, it works just fine. I've also
tried a label and had the same results.

Anybody have any thoughts?

TIA

Here's the code:

The code in the head section:
<script language="JavaScript">
function disp_confirm()
{
var txtAD
var txt

txtAD = document.getElementById('lblDisplayMessage')
txtAD.value
if (txt != '')
{
var name=confirm(txt)
}
}
</script>
The code for the text box:
<asp:TextBox id="lblDisplayMessage"
Runat="server">test</asp:TextBox>


Nov 19 '05 #4

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

Similar topics

9
by: Targa | last post by:
Ive seen alert scripts triggered by links but I need one that will cover any link or pressing the back/forward buttons. Any such thing? TIA
3
by: Roy Wang | last post by:
hi, My problem is how to determining when the XML file has loaded using javascript. I loaded an xml file using javascript in a web page. The code below is loading the xml file for IE:...
3
by: vanisathish | last post by:
Hi I am running a client side javascript timer to periodically refresh the contents of some tables in the HTML page. The table values are dynmically binded from XML DOM object using the <XML tag...
4
by: PH | last post by:
Does anyone know how to have the pop-up javascript alert, Response.Write("<script language=javascript>alert('HEY!');</script>); , pop-up after the page has been posted back? I am pressing a...
0
by: Chris Fink | last post by:
My goal is to have an ASP.NET checkbox server tag with it's autopostback set to true, that when clicked will run the checkbox's CheckedChanged event. However, I would like to try to add a...
0
by: deepak | last post by:
i have set multiple selection property in bith listboxes(html control) to true. i have taken 2 buttons(html control) say Button1,Button2.now i want to add mutiple selected items to another listbox...
5
by: Dave | last post by:
I have an app with several web forms. Code for each of the forms contains a subroutine I wrote that performs the Javascript function "alert". Thus: Private Sub DisplayAlert(ByVal msg As String)...
1
by: newToAjax | last post by:
I have created an ajax application which retrievs an xml file and fills in the tab fields on the form.The code works fine in IE while its does not in Mozilla. Can you please let me know if i have to...
4
by: clentoc | last post by:
I'm pretty new to javascript so this may well be a really basic error, but I've spent hours trying to fix it with no joy. I have written some code which looks in a CSV file, filters it depending...
2
by: sindhu | last post by:
Hello, I'm loading a frame from another frame using anchor tag. the code is as folllows. function change_page { if(document.form.txtbx1.value=="all") { ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.