javascript - ASP.Net checkbox postback doesn't fire -


i'm making change existing asp.net application via js. i'm unable @ nor edit original asp.net code. able inject js webpage. there 2 radio buttons, , want change default 1 other, can via js. when using web app, when other radio chosen can see there server post happening , js code toggle checkbox not fire this. because of this, server side function isn't getting ran allow me submit form.

just reference here js code works fine, nothing troubleshoot here. after inspecting radio in chrome i'm unable see event being fired. might not understand how inspect elements in chrome, advice?

$(window).load(function() {     // tests selected value     if ($("input[name*='radshippingaddresslist']:checked").val() == "radselectaddress") {       // changes radio button          $("input[name*='radshippingaddresslist'][value='radasbilling']").prop("checked", true);     } }); 

you need invoke click method on checkbox, in order post-back happen , server side code run. try doing instead of setting checked true:

$("input[name*='radshippingaddresslist'][value='radasbilling']").click();


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -