Home All Groups Group Topic Archive Search About


Author
2 May 2006 1:26 PM
Boki
Hi All,

I have many buttons that mapping many textbox, when I click button, I
want to show a string that contains button number( and the mapping
string ), but it failed.

Here is the code:
/////////////////////////////////////////////////////////////////////
<%response.write"<input type='button' name='bt_resone"& a &"'
value='Save' onclick='resone("&a&")'>"%>


function resone(cnt)
{
alert("document.all.txt_note"+cnt)
}

////////////////////////////////////////////////

It seems that the component I called is not there...
Could you please advice? Thank you so much!

Best regards,
Boki.

Author
2 May 2006 3:49 PM
Boki
Boki wrote:
Show quote
> Hi All,
>
> I have many buttons that mapping many textbox, when I click button, I
> want to show a string that contains button number( and the mapping
> string ), but it failed.
>
> Here is the code:
> /////////////////////////////////////////////////////////////////////
> <%response.write"<input type='button' name='bt_resone"& a &"'
> value='Save' onclick='resone("&a&")'>"%>
>
>
> function resone(cnt)
> {
>  alert("document.all.txt_note"+cnt)
> }
>
> ////////////////////////////////////////////////
>
> It seems that the component I called is not there...
> Could you please advice? Thank you so much!
>

..... it should be ... can javascript convert int to string directly? (
no enviroment to test now...)
alert(document.all.txt_note+cnt)


Show quote
> Best regards,
> Boki.
Author
2 May 2006 4:40 PM
Tim Slattery
"Boki" <bokit***@ms21.hinet.net> wrote:

>.... it should be ... can javascript convert int to string directly? (

Yes, the toString(...) function does exactly that.

var xx = 5;

var yy = xx.toString();

yy is a String containing "5".

--
Tim Slattery
MS MVP(DTS)
Slatter***@bls.gov

AddThis Social Bookmark Button