Jump to content

Replace javascript when checkbox state changes

Recommended Posts

Hi All,


How can I replace the "Non-recurring default script" with "Recurring script" buttons when the checkbox is checked?


I can only go this far: http://jsfiddle.net/k53nv/


Buttons sample:


Non-recurring script (default):

<script type="text/javascript" src="https://03a4d20.netsolstores.com/add-a-store.aspx?pid=4&lid=8"></script>Recurring script:

<script type="text/javascript" src="https://03a4d20.netsolstores.com/add-a-store.aspx?pid=1&lid=8"></script>


I need to drop the full HTML code/script to my WordPress website.


Thank you in advance.

Edited by gunaweb
Link to post
Share on other sites

Not exactly clear about what you want to achieve, but in your check function instead of setting 'result', can't you just insert the recurring or non-recurring code (or a call to it) as appropriate.


Edit: It occurred to me after answering with the sentence above that you may want another button, the action of which is altered depending on the setting of the checkbox. Is that correct?

Edited by johncc
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...