Rank: Member
Groups: Authorized User, Developers Joined: 11/12/2018(UTC) Posts: 25
Thanks: 1 times Was thanked: 4 time(s) in 3 post(s)
|
I'm pretty new to MVC/razor/javascript/jquery. I'm working on upgrading our highly customized AC Gold site to AC 9. On the AC Gold site I have a widget in ConLib that has code similar to the following in the ascx file: Code: ...
<asp:Button ID="DoSomethingButton" runat="server" Text="Click to do something" OnClick="DoSomethingButton_Click" ValidationGroup="SomethingVal" TabIndex="8" />
<table runat="server" id="detailsTable" class="inputForm" cellpadding="0" cellspacing="0" align="center" visible="false">
...
</table>
...
The code-behind then had: Code: protected void DoSomethingButton_Click(object sender, EventArgs e)
{
detailsTable.Visible = true;
....
}
I'm trying to figure out how to do this in an AC 9 widget. I have everything "wired up" so the widget is on an inner template and displays properly with the table hidden. From searching online, it seems like I should be able to do something like this in the onclick property for the button: Code: <input id="DoSomethingButton" type="button" class="btn btn-lg btn-block" value="Click to do something" onclick="$('#detailsTable').css('display','normal')" />
<table id="detailsTable" class="inputForm" cellpadding="0" cellspacing="0" align="center" style="display:none">
....
</table>
However, that doesn't work. I also tried .show instead of .css(...), but that didn't work either. I can set a breakpoint on that line of script in the browser's debugger, and it seems to execute, but nothing happens. Can anyone give me nudge in the right direction to accomplish this?
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
You can try changing this
$('#detailsTable').css('display','normal')
to
$('#detailsTable').css('display','block')
|
1 user thanked shaharyar for this useful post.
|
|
|
Rank: Member
Groups: Authorized User, Developers Joined: 11/12/2018(UTC) Posts: 25
Thanks: 1 times Was thanked: 4 time(s) in 3 post(s)
|
Thank you shaharyar, "block" works. I'm not sure where I got the "normal" value from, I should have made sure it was a valid option!
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close