Web Analytics Made Easy -
StatCounter How to change button text based on CheckBox Checked or not - CodingForum

Announcement

Collapse
No announcement yet.

How to change button text based on CheckBox Checked or not

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to change button text based on CheckBox Checked or not

    Currently on my page [PHP5] I have a checkbox & a input button (among other things), the button text now is hardcoded to "Next" but I need this to change based on the status of the Checkbox (cBusAcc). For example, when cBusAcc is not checked the button should be "Create", when it is checked the button should be "Next".

    And this change should occur without the user needing to press on the button, just check/uncheck should change the button test...
    See the code I have so far below...


    Code:
    ...
    <input type="checkbox" name="cBusAcc" id="cBusAcc" />
    <input name="signup" id="signup" type="submit" value="Next" />
    ...How can I accomplish this (I've got no clue...)
    Any help or hints would be very much appreciated.

    Thanks,

  • #2
    Code:
    <input type="checkbox" name="cBusAcc" id="cBusAcc" 
      [COLOR="Red"]onclick="this.form.signup.value=this.checked?'Next':'Create';" [/COLOR]/>
    <input name="signup" id="signup" type="submit" value="Next" />
    Be yourself. No one else is as qualified.

    Comment

    Working...
    X