473,802 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems with client scripting invoked from DataGrid OnItemDataBound Event

Hello,

I have the following problem:
I have a DataGrid control on my page with a column with TextBox controls and
another one with ImageButton controls. In order to force a call to
JavaScript client-side script when ImageButton is pressed, I added the
following code to OnItemDataBound Event (check for Item Types not shown
here):

Dim tbKolicina As TextBox = e.Item.Cells(6) .FindControl("t bKolicina")
Dim imgbtKosarica As ImageButton =
e.Item.Cells(7) .FindControl("i mgbtKosarica")
imgbtKosarica.A ttributes.Add(" onClick", "return validacija('" &
tbKolicina.Text & "')")

"tbKolicina " is the TextBox control whose value I want to pass to JavaScript
for validation when ImageButton called "imgbtKosar ica" is clicked.
JavaScript is currently just an elementary script (no validation yet) and
should simply display an alert box with the passed parameter
(tbKolicinaText ) displayed when the ImageButton is clicked.

It works fine (finds the controls and calls the JavaScript) up to one final
point: the value of the TextBox (tbKolicina.tex t) doesn't reach the
JavaScript script. Whatever I write into the TextBox, I receive an empty
alert box. But, if I set the value for the tbKolicina.text programatically ,
that value does get passed. I concluded therefore that only the initial
value reaches JavaScript.

What did I do wrong and how could I make this validation work?

Thank you in advance,
Hrvoje
Nov 17 '05 #1
11 1238
Hi

This should pass the value of tbKolicina field to the function
imgbtKosarica.A ttributes.Add(" onclick", "return
validacija(this .form.tbKolicin a.value)")

--
Best Regards
Vidar Petursson
=============== ===============
Microsoft Internet Client & Controls MVP
=============== ===============
"Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hello,

I have the following problem:
I have a DataGrid control on my page with a column with TextBox controls and another one with ImageButton controls. In order to force a call to
JavaScript client-side script when ImageButton is pressed, I added the
following code to OnItemDataBound Event (check for Item Types not shown
here):

Dim tbKolicina As TextBox = e.Item.Cells(6) .FindControl("t bKolicina")
Dim imgbtKosarica As ImageButton =
e.Item.Cells(7) .FindControl("i mgbtKosarica")
imgbtKosarica.A ttributes.Add(" onClick", "return validacija('" &
tbKolicina.Text & "')")

"tbKolicina " is the TextBox control whose value I want to pass to JavaScript for validation when ImageButton called "imgbtKosar ica" is clicked.
JavaScript is currently just an elementary script (no validation yet) and
should simply display an alert box with the passed parameter
(tbKolicinaText ) displayed when the ImageButton is clicked.

It works fine (finds the controls and calls the JavaScript) up to one final point: the value of the TextBox (tbKolicina.tex t) doesn't reach the
JavaScript script. Whatever I write into the TextBox, I receive an empty
alert box. But, if I set the value for the tbKolicina.text programatically , that value does get passed. I concluded therefore that only the initial
value reaches JavaScript.

What did I do wrong and how could I make this validation work?

Thank you in advance,
Hrvoje

Nov 17 '05 #2
Vidar,

thank you for the advice.
Unfortunately, it still doesn't work - it displays error message within the
alert box: "'this.form.tbK olicina.value' is null or not an
object"....some how it doesn't recognize it.

Hrvoje
"Vidar Petursson" <th*****@icysof t.com> wrote in message
news:OY******** *****@TK2MSFTNG P10.phx.gbl...
Hi

This should pass the value of tbKolicina field to the function
imgbtKosarica.A ttributes.Add(" onclick", "return
validacija(this .form.tbKolicin a.value)")

--
Best Regards
Vidar Petursson
=============== ===============
Microsoft Internet Client & Controls MVP
=============== ===============
"Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hello,

I have the following problem:
I have a DataGrid control on my page with a column with TextBox controls

and
another one with ImageButton controls. In order to force a call to
JavaScript client-side script when ImageButton is pressed, I added the
following code to OnItemDataBound Event (check for Item Types not shown
here):

Dim tbKolicina As TextBox = e.Item.Cells(6) .FindControl("t bKolicina")
Dim imgbtKosarica As ImageButton =
e.Item.Cells(7) .FindControl("i mgbtKosarica")
imgbtKosarica.A ttributes.Add(" onClick", "return validacija('" &
tbKolicina.Text & "')")

"tbKolicina " is the TextBox control whose value I want to pass to

JavaScript
for validation when ImageButton called "imgbtKosar ica" is clicked.
JavaScript is currently just an elementary script (no validation yet) and should simply display an alert box with the passed parameter
(tbKolicinaText ) displayed when the ImageButton is clicked.

It works fine (finds the controls and calls the JavaScript) up to one

final
point: the value of the TextBox (tbKolicina.tex t) doesn't reach the
JavaScript script. Whatever I write into the TextBox, I receive an empty
alert box. But, if I set the value for the tbKolicina.text

programatically ,
that value does get passed. I concluded therefore that only the initial
value reaches JavaScript.

What did I do wrong and how could I make this validation work?

Thank you in advance,
Hrvoje


Nov 17 '05 #3
Hi

Make sure the field is there and you have the name spelled correctly ( case
sensitive )

--
Best Regards
Vidar Petursson
=============== ===============
Microsoft Internet Client & Controls MVP
=============== ===============
"Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
news:uN******** ******@TK2MSFTN GP10.phx.gbl...
Vidar,

thank you for the advice.
Unfortunately, it still doesn't work - it displays error message within the alert box: "'this.form.tbK olicina.value' is null or not an
object"....some how it doesn't recognize it.

Hrvoje
"Vidar Petursson" <th*****@icysof t.com> wrote in message
news:OY******** *****@TK2MSFTNG P10.phx.gbl...
Hi

This should pass the value of tbKolicina field to the function
imgbtKosarica.A ttributes.Add(" onclick", "return
validacija(this .form.tbKolicin a.value)")

--
Best Regards
Vidar Petursson
=============== ===============
Microsoft Internet Client & Controls MVP
=============== ===============
"Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hello,

I have the following problem:
I have a DataGrid control on my page with a column with TextBox controls
and
another one with ImageButton controls. In order to force a call to
JavaScript client-side script when ImageButton is pressed, I added the
following code to OnItemDataBound Event (check for Item Types not shown
here):

Dim tbKolicina As TextBox = e.Item.Cells(6) .FindControl("t bKolicina")
Dim imgbtKosarica As ImageButton =
e.Item.Cells(7) .FindControl("i mgbtKosarica")
imgbtKosarica.A ttributes.Add(" onClick", "return validacija('" &
tbKolicina.Text & "')")

"tbKolicina " is the TextBox control whose value I want to pass to

JavaScript
for validation when ImageButton called "imgbtKosar ica" is clicked.
JavaScript is currently just an elementary script (no validation yet) and should simply display an alert box with the passed parameter
(tbKolicinaText ) displayed when the ImageButton is clicked.

It works fine (finds the controls and calls the JavaScript) up to one

final
point: the value of the TextBox (tbKolicina.tex t) doesn't reach the
JavaScript script. Whatever I write into the TextBox, I receive an

empty alert box. But, if I set the value for the tbKolicina.text

programatically ,
that value does get passed. I concluded therefore that only the initial value reaches JavaScript.

What did I do wrong and how could I make this validation work?

Thank you in advance,
Hrvoje



Nov 17 '05 #4
Hello and thank you, John.

As alert box shows, nothing was put in JavaScript, i.e., the source says
onclick="return validacija('')" , just as if the text box was empty (no value
for the parameter). Funny, but the same source shows correct value in the
text box parameters, e.g. <input name="dgProdukt i:_ctl4:tbKolic ina"
type="text" value="711" id="dgProdukti_ _ctl4_tbKolicin a" />, 711 being the
entered number that doesn't reach the JavaScript....
Funny!

Hrvoje
"John Saunders" <jo***********@ surfcontrol.com > wrote in message
news:#L******** ******@TK2MSFTN GP09.phx.gbl...
Hrvoje,

Take a look at the generated HTML with View Source in IE. Look to see what
was put into your JavaScript.
-- .e.
John Saunders
Internet Engineer
jo***********@s urfcontrol.com

"Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
news:uN******** ******@TK2MSFTN GP10.phx.gbl...
Vidar,

thank you for the advice.
Unfortunately, it still doesn't work - it displays error message within

the
alert box: "'this.form.tbK olicina.value' is null or not an
object"....some how it doesn't recognize it.

Hrvoje
"Vidar Petursson" <th*****@icysof t.com> wrote in message
news:OY******** *****@TK2MSFTNG P10.phx.gbl...
Hi

This should pass the value of tbKolicina field to the function
imgbtKosarica.A ttributes.Add(" onclick", "return
validacija(this .form.tbKolicin a.value)")

--
Best Regards
Vidar Petursson
=============== ===============
Microsoft Internet Client & Controls MVP
=============== ===============
"Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
> Hello,
>
> I have the following problem:
> I have a DataGrid control on my page with a column with TextBox controls and
> another one with ImageButton controls. In order to force a call to
> JavaScript client-side script when ImageButton is pressed, I added the > following code to OnItemDataBound Event (check for Item Types not shown > here):
>
> Dim tbKolicina As TextBox = e.Item.Cells(6) .FindControl("t bKolicina") > Dim imgbtKosarica As ImageButton =
> e.Item.Cells(7) .FindControl("i mgbtKosarica")
> imgbtKosarica.A ttributes.Add(" onClick", "return validacija('" &
> tbKolicina.Text & "')")
>
> "tbKolicina " is the TextBox control whose value I want to pass to
JavaScript
> for validation when ImageButton called "imgbtKosar ica" is clicked.
> JavaScript is currently just an elementary script (no validation yet)
and
> should simply display an alert box with the passed parameter
> (tbKolicinaText ) displayed when the ImageButton is clicked.
>
> It works fine (finds the controls and calls the JavaScript) up to
one final
> point: the value of the TextBox (tbKolicina.tex t) doesn't reach the
> JavaScript script. Whatever I write into the TextBox, I receive an

empty > alert box. But, if I set the value for the tbKolicina.text
programatically ,
> that value does get passed. I concluded therefore that only the initial > value reaches JavaScript.
>
> What did I do wrong and how could I make this validation work?
>
> Thank you in advance,
> Hrvoje
>
>



Nov 17 '05 #5
I just took a quick look back at your code. You're taking the value out of
the TextBox in OnItemDataBound , but when did you put a value _into_ the
TextBox?
--
John Saunders
Internet Engineer
jo***********@s urfcontrol.com

"vrba" <hr*****@recro. hr> wrote in message
news:OC******** ******@tk2msftn gp13.phx.gbl...
Hello and thank you, John.

As alert box shows, nothing was put in JavaScript, i.e., the source says
onclick="return validacija('')" , just as if the text box was empty (no value for the parameter). Funny, but the same source shows correct value in the
text box parameters, e.g. <input name="dgProdukt i:_ctl4:tbKolic ina"
type="text" value="711" id="dgProdukti_ _ctl4_tbKolicin a" />, 711 being the
entered number that doesn't reach the JavaScript....
Funny!

Hrvoje
"John Saunders" <jo***********@ surfcontrol.com > wrote in message
news:#L******** ******@TK2MSFTN GP09.phx.gbl...
Hrvoje,

Take a look at the generated HTML with View Source in IE. Look to see what
was put into your JavaScript.
-- .e.
John Saunders
Internet Engineer
jo***********@s urfcontrol.com

"Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
news:uN******** ******@TK2MSFTN GP10.phx.gbl...
Vidar,

thank you for the advice.
Unfortunately, it still doesn't work - it displays error message within
the
alert box: "'this.form.tbK olicina.value' is null or not an
object"....some how it doesn't recognize it.

Hrvoje
"Vidar Petursson" <th*****@icysof t.com> wrote in message
news:OY******** *****@TK2MSFTNG P10.phx.gbl...
> Hi
>
> This should pass the value of tbKolicina field to the function
> imgbtKosarica.A ttributes.Add(" onclick", "return
> validacija(this .form.tbKolicin a.value)")
>
> --
> Best Regards
> Vidar Petursson
> =============== ===============
> Microsoft Internet Client & Controls MVP
> =============== ===============
> "Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
> news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
> > Hello,
> >
> > I have the following problem:
> > I have a DataGrid control on my page with a column with TextBox

controls
> and
> > another one with ImageButton controls. In order to force a call to
> > JavaScript client-side script when ImageButton is pressed, I added

the > > following code to OnItemDataBound Event (check for Item Types not shown > > here):
> >
> > Dim tbKolicina As TextBox = e.Item.Cells(6) .FindControl("t bKolicina") > > Dim imgbtKosarica As ImageButton =
> > e.Item.Cells(7) .FindControl("i mgbtKosarica")
> > imgbtKosarica.A ttributes.Add(" onClick", "return validacija('" &
> > tbKolicina.Text & "')")
> >
> > "tbKolicina " is the TextBox control whose value I want to pass to
> JavaScript
> > for validation when ImageButton called "imgbtKosar ica" is clicked.
> > JavaScript is currently just an elementary script (no validation yet) and
> > should simply display an alert box with the passed parameter
> > (tbKolicinaText ) displayed when the ImageButton is clicked.
> >
> > It works fine (finds the controls and calls the JavaScript) up to one > final
> > point: the value of the TextBox (tbKolicina.tex t) doesn't reach

the > > JavaScript script. Whatever I write into the TextBox, I receive an

empty
> > alert box. But, if I set the value for the tbKolicina.text
> programatically ,
> > that value does get passed. I concluded therefore that only the

initial
> > value reaches JavaScript.
> >
> > What did I do wrong and how could I make this validation work?
> >
> > Thank you in advance,
> > Hrvoje
> >
> >
>
>



Nov 17 '05 #6
Hello John,
hm, I thought that OnItemDataBound I just wire the script and that values
could be transferred later.....obvio usly a mistake. I was thinking about
that but if I put my code inside OnSelectedIndex Changed event, then the page
doesn't react on the first click (because only then is the script activated)
but only when the same ImageButton is clicked for the second time....
Therefore, it seems I need the new solution.

Thank you,
Hrvoje

"John Saunders" <jo***********@ surfcontrol.com > wrote in message
news:uV******** ******@TK2MSFTN GP10.phx.gbl...
I just took a quick look back at your code. You're taking the value out of
the TextBox in OnItemDataBound , but when did you put a value _into_ the
TextBox?
--
John Saunders
Internet Engineer
jo***********@s urfcontrol.com

"vrba" <hr*****@recro. hr> wrote in message
news:OC******** ******@tk2msftn gp13.phx.gbl...
Hello and thank you, John.

As alert box shows, nothing was put in JavaScript, i.e., the source says
onclick="return validacija('')" , just as if the text box was empty (no

value
for the parameter). Funny, but the same source shows correct value in the
text box parameters, e.g. <input name="dgProdukt i:_ctl4:tbKolic ina"
type="text" value="711" id="dgProdukti_ _ctl4_tbKolicin a" />, 711 being the entered number that doesn't reach the JavaScript....
Funny!

Hrvoje
"John Saunders" <jo***********@ surfcontrol.com > wrote in message
news:#L******** ******@TK2MSFTN GP09.phx.gbl...
Hrvoje,

Take a look at the generated HTML with View Source in IE. Look to see what was put into your JavaScript.
-- .e.
John Saunders
Internet Engineer
jo***********@s urfcontrol.com

"Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
news:uN******** ******@TK2MSFTN GP10.phx.gbl...
> Vidar,
>
> thank you for the advice.
> Unfortunately, it still doesn't work - it displays error message within the
> alert box: "'this.form.tbK olicina.value' is null or not an
> object"....some how it doesn't recognize it.
>
> Hrvoje
>
>
> "Vidar Petursson" <th*****@icysof t.com> wrote in message
> news:OY******** *****@TK2MSFTNG P10.phx.gbl...
> > Hi
> >
> > This should pass the value of tbKolicina field to the function
> > imgbtKosarica.A ttributes.Add(" onclick", "return
> > validacija(this .form.tbKolicin a.value)")
> >
> > --
> > Best Regards
> > Vidar Petursson
> > =============== ===============
> > Microsoft Internet Client & Controls MVP
> > =============== ===============
> > "Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
> > news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
> > > Hello,
> > >
> > > I have the following problem:
> > > I have a DataGrid control on my page with a column with TextBox
controls
> > and
> > > another one with ImageButton controls. In order to force a call to > > > JavaScript client-side script when ImageButton is pressed, I added the
> > > following code to OnItemDataBound Event (check for Item Types not

shown
> > > here):
> > >
> > > Dim tbKolicina As TextBox =

e.Item.Cells(6) .FindControl("t bKolicina")
> > > Dim imgbtKosarica As ImageButton =
> > > e.Item.Cells(7) .FindControl("i mgbtKosarica")
> > > imgbtKosarica.A ttributes.Add(" onClick", "return validacija('" &
> > > tbKolicina.Text & "')")
> > >
> > > "tbKolicina " is the TextBox control whose value I want to pass
to > > JavaScript
> > > for validation when ImageButton called "imgbtKosar ica" is clicked. > > > JavaScript is currently just an elementary script (no validation

yet)
> and
> > > should simply display an alert box with the passed parameter
> > > (tbKolicinaText ) displayed when the ImageButton is clicked.
> > >
> > > It works fine (finds the controls and calls the JavaScript) up to
one
> > final
> > > point: the value of the TextBox (tbKolicina.tex t) doesn't reach

the > > > JavaScript script. Whatever I write into the TextBox, I receive

an empty
> > > alert box. But, if I set the value for the tbKolicina.text
> > programatically ,
> > > that value does get passed. I concluded therefore that only the
initial
> > > value reaches JavaScript.
> > >
> > > What did I do wrong and how could I make this validation work?
> > >
> > > Thank you in advance,
> > > Hrvoje
> > >
> > >
> >
> >
>
>



Nov 17 '05 #7
"Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hello John,
hm, I thought that OnItemDataBound I just wire the script and that values
could be transferred later.....obvio usly a mistake.


Nope. In OnItemDataBound you're supposed to bind data to the controls in the
item if they don't do that on their own. For instance, I have an employee
list datagrid with a Delete LinkButton in it. I use ItemDataBound to set the
JavaScript which displays the confirm dialog, and I take the opportunity to
concatenate the first and last name of the employee being deleted. I have a
HyperLink control in the same grid, and I set the NavigateUrl in the
ItemDataBound event to include the employee ID in the query string of the
URL.

So, I use it for things which are too complicated for a databinding
expression to handle, or for things where the databinding expression is
simply too complicated or ugly to look at in the .aspx file. I move it into
the .aspx.cs file where nobody needs to see it!
--
John Saunders
Internet Engineer
jo***********@s urfcontrol.com
Nov 17 '05 #8
I understand.
But what is the solution for my problems then (a rhetorical question :-))?

Hrvoje
"John Saunders" <jo***********@ surfcontrol.com > wrote in message
news:#x******** *****@TK2MSFTNG P10.phx.gbl...
"Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hello John,
hm, I thought that OnItemDataBound I just wire the script and that values could be transferred later.....obvio usly a mistake.
Nope. In OnItemDataBound you're supposed to bind data to the controls in

the item if they don't do that on their own. For instance, I have an employee
list datagrid with a Delete LinkButton in it. I use ItemDataBound to set the JavaScript which displays the confirm dialog, and I take the opportunity to concatenate the first and last name of the employee being deleted. I have a HyperLink control in the same grid, and I set the NavigateUrl in the
ItemDataBound event to include the employee ID in the query string of the
URL.

So, I use it for things which are too complicated for a databinding
expression to handle, or for things where the databinding expression is
simply too complicated or ugly to look at in the .aspx file. I move it into the .aspx.cs file where nobody needs to see it!
--
John Saunders
Internet Engineer
jo***********@s urfcontrol.com

Nov 17 '05 #9
Hello John,
hm, I thought that OnItemDataBound I just wire the script and that values
could be transferred later.....obvio usly a mistake. I was thinking about
that but if I put my code inside OnSelectedIndex Changed event, then the page
doesn't react on the first click (because only then is the script activated)
but only when the same ImageButton is clicked for the second time....
Therefore, it seems I need the new solution.

Thank you,
Hrvoje

"John Saunders" <jo***********@ surfcontrol.com > wrote in message
news:uV******** ******@TK2MSFTN GP10.phx.gbl...
I just took a quick look back at your code. You're taking the value out of
the TextBox in OnItemDataBound , but when did you put a value _into_ the
TextBox?
--
John Saunders
Internet Engineer
jo***********@s urfcontrol.com

"vrba" <hr*****@recro. hr> wrote in message
news:OC******** ******@tk2msftn gp13.phx.gbl...
Hello and thank you, John.

As alert box shows, nothing was put in JavaScript, i.e., the source says
onclick="return validacija('')" , just as if the text box was empty (no

value
for the parameter). Funny, but the same source shows correct value in the
text box parameters, e.g. <input name="dgProdukt i:_ctl4:tbKolic ina"
type="text" value="711" id="dgProdukti_ _ctl4_tbKolicin a" />, 711 being the entered number that doesn't reach the JavaScript....
Funny!

Hrvoje
"John Saunders" <jo***********@ surfcontrol.com > wrote in message
news:#L******** ******@TK2MSFTN GP09.phx.gbl...
Hrvoje,

Take a look at the generated HTML with View Source in IE. Look to see what was put into your JavaScript.
-- .e.
John Saunders
Internet Engineer
jo***********@s urfcontrol.com

"Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
news:uN******** ******@TK2MSFTN GP10.phx.gbl...
> Vidar,
>
> thank you for the advice.
> Unfortunately, it still doesn't work - it displays error message within the
> alert box: "'this.form.tbK olicina.value' is null or not an
> object"....some how it doesn't recognize it.
>
> Hrvoje
>
>
> "Vidar Petursson" <th*****@icysof t.com> wrote in message
> news:OY******** *****@TK2MSFTNG P10.phx.gbl...
> > Hi
> >
> > This should pass the value of tbKolicina field to the function
> > imgbtKosarica.A ttributes.Add(" onclick", "return
> > validacija(this .form.tbKolicin a.value)")
> >
> > --
> > Best Regards
> > Vidar Petursson
> > =============== ===============
> > Microsoft Internet Client & Controls MVP
> > =============== ===============
> > "Hrvoje Vrbanc" <hr*****@recro. hr> wrote in message
> > news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
> > > Hello,
> > >
> > > I have the following problem:
> > > I have a DataGrid control on my page with a column with TextBox
controls
> > and
> > > another one with ImageButton controls. In order to force a call to > > > JavaScript client-side script when ImageButton is pressed, I added the
> > > following code to OnItemDataBound Event (check for Item Types not

shown
> > > here):
> > >
> > > Dim tbKolicina As TextBox =

e.Item.Cells(6) .FindControl("t bKolicina")
> > > Dim imgbtKosarica As ImageButton =
> > > e.Item.Cells(7) .FindControl("i mgbtKosarica")
> > > imgbtKosarica.A ttributes.Add(" onClick", "return validacija('" &
> > > tbKolicina.Text & "')")
> > >
> > > "tbKolicina " is the TextBox control whose value I want to pass
to > > JavaScript
> > > for validation when ImageButton called "imgbtKosar ica" is clicked. > > > JavaScript is currently just an elementary script (no validation

yet)
> and
> > > should simply display an alert box with the passed parameter
> > > (tbKolicinaText ) displayed when the ImageButton is clicked.
> > >
> > > It works fine (finds the controls and calls the JavaScript) up to
one
> > final
> > > point: the value of the TextBox (tbKolicina.tex t) doesn't reach

the > > > JavaScript script. Whatever I write into the TextBox, I receive

an empty
> > > alert box. But, if I set the value for the tbKolicina.text
> > programatically ,
> > > that value does get passed. I concluded therefore that only the
initial
> > > value reaches JavaScript.
> > >
> > > What did I do wrong and how could I make this validation work?
> > >
> > > Thank you in advance,
> > > Hrvoje
> > >
> > >
> >
> >
>
>



Nov 17 '05 #10

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

Similar topics

5
4607
by: Tyler Style | last post by:
Hullo - looking for a little advice here. I have a form on a page in one domain submitting to a cgi in another domain. Weirdly, on some Windows XP systems, a form on the page fails to submit/post properly to the cgi and users get the message from IE that it "Cannot find server: The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to...
55
4218
by: drhowarddrfine | last post by:
I'm working on a web site that could use some control using js but am concerned about what problems I may have with potential users having their js turned off. Has anyone had any serious problems with this sort of thing? I know some of these potential users are with big companies and am wondering if anyone had real problems with that.
4
1563
by: - R | last post by:
Hello all. I'm new to .Net so please help me out. I have a application with several "Threads" running to observe various things. From time to time each thread need to add an log entry, which is displayed on a form (a datagrid on a form) there is no database, but i created a dataset using the designer. One Entity/Table is called Log and contains the log-entries.
2
2046
by: cedced | last post by:
Hello, is it possible to access client files in VB.NET? What? I have doing that but it isn't good (VB.NET take file on pc server and not on pc client): (thanks) Dim fichier As StreamReader Dim name As String
2
1461
by: Paul | last post by:
If it's possible I would like to perform some client side actions on my Visual Basic asp.net application. An example of what I'm trying to do. I have a DATAGRID with columns ITEM, ITEMTYPE and a template column with a checkbox in it called "MATCH" Example ITEM ITEMTYPE MATCH Banana Fruit Vegatable
6
1959
by: rishabhshrivastava | last post by:
Hello All, I am using ASP.NET 2.0 and I am experiencing a problem using vbscript that is this script on client side is preventing the postback of my controls. I have a dropdownlist which is supposed to perform some fucntion when the selected index is changed, it works fine without vbscript code(when i comment out that code) but when I uncomment the code the postback dosen't happen.
12
2912
by: SAL | last post by:
Hello, Is it possible to read a CSV from the Client, and bind my Datagrid to the data in the CSV file without uploading the file to the Server first? I have tried and in Debug mode on my workstation it works fine, but when I publish the page on our DEV server it doesn't fine the CSV file from the client. Has anyone done this before? If so, how do I do it? I'm new to ASP.net so
0
9699
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
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,...
0
10538
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, 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...
1
10285
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7598
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
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();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
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 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...

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.