Page breaking when using Javascript to click a button

On my page I have the user enter a string into a field.  From this field I run some code behind to check for multiple matches.  If true, I display a table of each of these options.  If they click a row in the column I have javascript that will grab the unique id, put it into the field they initially entered a number into, and auto click the same button for them.  When I do this the page breaks (nothing on the page functions at all).  If I write the number from the table down, reload the page and enter it manually, the page functions correctly.  

The javascript seems to be breaking my page somehow.  Any help understanding what would cause the page to break would be very helpful. Thank You.

Javascript
        function pullDeal(DealNumber) {
            var txt = $find('ctl00_maincontentholder_txtDealNumber');
            var btn = document.getElementById('ctl00_maincontentholder_btnDownloadDeal');
            var pnl = document.getElementById('ctl00_maincontentholder_pnlDealSelection');
            txt.set_value(DealNumber);
            txt.disabled = true;
            pnl.style.display = "none";
            btn.click();
        }

Open in new window


AjaxSetting (for updating the table)
<telerik:AjaxSetting AjaxControlID="ibtnDownload">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlDealSelection" LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>

Open in new window


Onclick for the row of the table
onclick="pullDeal('<%#Eval("DealNumber")%>'); return false;"

Open in new window

huston8481Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kim WalkerWeb Programmer/TechnicianCommented:
Do you have this posted somewhere so we can see what errors are being generated?
0
huston8481Author Commented:
No, it is on a private site.  I am unable to find the error, because it is being hidden behind ajax.  I am in the process of disabling the update panels to see the error.  Any help on this would be appreciated.
0
huston8481Author Commented:
This is the exception I received.  If i take out my debugging code in the code behind it works fine.

I was able to fix it by simply removing the offending line of code which writes information to me in a text box.  But I am interested in finding out why it would do this, for education purposes.

Exception
Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (ctl00$maincontentholder$salvotest="...e entered.<br /> Please select...").

Open in new window


Code Behind that was breaking it, which is odd because it should not run the second time the button is clicked.
salvotest.Text += "More than one deal was found for the Stock Number you have entered.<br /> Please select the correct deal to continue."

Open in new window

0
huston8481Author Commented:
After further inspection it seems that having a "<br>" go to my text box is scaring it into think I'm "injecting" some code into my page.

Annoying little problems...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
huston8481Author Commented:
With the help of a co-worker and myself the problem was solved by removing the <br/> tag from the textbox output.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.