inherit
150365
0
Aug 5, 2018 18:51:31 GMT -8
Violet
Oh, bless your heart.
2,928
December 2009
watchmen2013
|
Post by Violet on Aug 23, 2013 12:25:20 GMT -8
Your help would be greatly appreciated. Thank you in advance. Okay so I'm trying to do something along the lines of:
.js
<script language="javascript" type="text/javascript" function OnFocus(){ if (cost = 0) { cost = ' '; } } </script> .aspx
<cc1:Currency ID="Cost" runat="server" ShowCents="true" MaxLength="10" onfocus="OnFocus()"/> But Visual C# doesn't have an OnFocus function. How do I get around that?
Also, the variable (cost) is being defined in the code behind (.aspx.cs). How do I get Javascript to recognize it?
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Aug 23, 2013 13:29:12 GMT -8
I don't know anything about ASP, but is there a way to force it to print a literal string out in the right place?
Alternatively, bind the onFocus from the JavaScript rather than in the HTML DOM.
|
|
inherit
150365
0
Aug 5, 2018 18:51:31 GMT -8
Violet
Oh, bless your heart.
2,928
December 2009
watchmen2013
|
Post by Violet on Aug 23, 2013 16:38:55 GMT -8
Well, see, the problem is I'm not working in HTML at all (if I were working in HTML, I could easily do it). As for the printing out of a literal string in the right place - the problem is what is wanted is for when the user clicks into a textbox (defaulted to 00) and the default info that in the field they want to go away when you click into the textbox. So it's not really an open string they want, they want nothing in the field OnFocus if the value=0. Does that make since?
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Aug 23, 2013 17:27:45 GMT -8
Yeah, that's well beyond my knowledge of ASP. So you could maybe still bind the value via JS? Or is that not possible either? (I'm probably making a fool of myself for all you ASP folks )
|
|