Re: Attributes.Add problem
Look at the source code of the html that is displayed in the browser. Is the ID attribute of the hidden field exactly 'hiddenChoice' or is it something else? (ASP.NET does change some IDs)
Re: Attributes.Add problem
Quote:
Originally Posted by mendhak
Look at the source code of the html that is displayed in the browser. Is the ID attribute of the hidden field exactly 'hiddenChoice' or is it something else? (ASP.NET does change some IDs)
Hi,
this is the code I get from the source:
VB Code:
input type="submit" name="btnApplyProposalDetail" value="Apply this proposal" id="btnApplyProposalDetail" onclick="ApplyProposalAccord();" />
The javascript function itself isn't found in the HTML when I search for it... Could that be the problem?
Re: Attributes.Add problem
Yes that will be a problem. Your first post said that it was in the .aspx page, so where did it go?
Re: Attributes.Add problem
Ok, I've found out is was hidden in a conditional IF statement (<%if somevariable=true and so on)...
Now, it asks me to apply as I want, it only doesn't fire the ASP.NET code...
I'm further than I've been... :) Thanx for the help so far, maybe u could help me with the last part...
Re: Attributes.Add problem
Have replaced the Webcontrols.Button by a HTMLButton. Now I get the error: document.getElementById( is null or not an object. Anyone knows how that could happen?
Re: Attributes.Add problem
Quote:
Originally Posted by JMvVliet
Hi,
this is the code I get from the source:
VB Code:
input type="submit" name="btnApplyProposalDetail" value="Apply this proposal" id="btnApplyProposalDetail" onclick="ApplyProposalAccord();" />
The javascript function itself isn't found in the HTML when I search for it... Could that be the problem?
That isn't the hidden field.
Also, how are you adding the javascript function to the page?
Re: Attributes.Add problem
The ApplyProposalAccord is inserted into the HTML part of the page. See the first post how I add the 'onclick' event to the attributes, calling ApplyProposalAccord.
ApplyProposalAccord:
VB Code:
function ApplyProposalAccord()
{
if (confirm("Do you wish to apply this proposal?"))
{
document.getElementById('hiddenChoice').value = 1;
document.forms[0].submit;
}
else
{
document.getElementById('hiddenChoice').value = 0;
document.forms[0].submit;
}
}
hiddenChoice is a variable inside the ASPX page:
VB Code:
Protected hiddenChoice As System.Web.UI.HtmlControls.HtmlInputHidden
Before finding out how to fire the events of this control (I need a WithEvents therefore, I think), I want to figure out why I get the error mentioned in my post before...
I am getting the message that asks me if I want to apply the proposal. But after clicking OK, the I get the mentioned message.
Thanx anyway...