2) " to get the control's containing form name "
One way i could think of is, you could get the parent control recursivly
until the parentElement.t agName == 'FORM'
I m writing below code on the fly... havent tested.. but hope it gives an
idea..
<script>
notFound = false;
ParentElem = document.getEle mentById("btton Name").parentEl ement;
while(notFound == false)
{
if(ParentElem.t agName == 'FORM')
{
//Now ParentElem is the FORM containing the control
// you my exit the loop and call ParentElem.Subm it();
document.writel n(ParentElem.id );
notFound = true;
}
else
ParentElem = ParentElem.pare ntElement;
}
</script>
this should work, but you will be able to come up with a more efficient
recursive script for the same.. probably you will find a sample in
blogs/sites
1) not sure i have understood the requirement... When you say " I have a
control that I want to act like a button" , is that a webcontrol or a user
control?.. if user control, you could still have a hidden control next to the
button/image/link you are expecting the user to click..
"PJ6" wrote:
I have a control that I want to act like a button. I cannot assume that the
containing page has a hidden control. I'm looking for a way to get the
client-side OnClick event to cause the server-side control event to fire.
Paul
"Sreejith Ram" <Sr*********@di scussions.micro soft.com> wrote in message
news:3C******** *************** ***********@mic rosoft.com... 1) document.forms[0].submit('test') is an invalid syntax.. If you are
looking
to send some additional value to server code, one common method is to use
a
HTML Hidden Control or a TextBox Webcontrol with size 0.. In the code
behind,
you could access the hidden control like Request.Form["HiddenCtrlName "]
.ToString();
2) document.SomeFo rmName.submit() ; is a valid syntax.
"PJ6" wrote:
When I have client-side script like this -
document.forms[0].submit('test')
how do I access, from server-side code, the value I put in the submit
method?
Also, is it possible to get the control's containing form name so I can
emite script like this -
document.SomeFo rmName.submit(' test')
so I don't have to assume it's in forms[0]?
Paul