Jump to content

Replace javascript when checkbox state changes


gunaweb

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 comment
Share on other sites

Hi jonhcc, thank you for your suggestion but that's where I am stuck now. I am a web designer who forced myself to do more programming :sorry:...and can't go beyond that. Do you think you can give me an example with the actual codes? Cheers!

Link to comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...