reset password
Author Message
emugi
Posts: 19
Posted 17:05 Mar 18, 2017 |

Hi I have trouble making the buttons to work. So I put the click function inside the document ready function with the button id and that's in a separate jsp file. And I have the input , value and id on the another html file which I makes the button on html page. But I don't think they are connected to each other. Anyone have an idea why its not working??  

amclees2
Posts: 12
Posted 17:20 Mar 18, 2017 |

I assume you mean js file rather than jsp file.

Things to check:

  1. Do you have a script tag inside your HTML?
  2. Is the id of the button you are trying to get the same one you are sending JQuery?
  3. Are you using an HTML button element, or some other kind of element for the button (input with type=button should still work)
  4. Are you properly using the JQuery selector with the # like on this page: https://api.jquery.com/id-selector/
  5. Are you properly using the click JQuery function like on this page: https://api.jquery.com/click/ (You can also use the onclick non-JQuery property)

 

emugi
Posts: 19
Posted 17:27 Mar 18, 2017 |

Yes I did check all the tag and html. The id is same before the click function and I did put # before the id. its so weird because when I do alert function than it works but when I put like function inside the click function than the page wont load... The professor told us that we are replacing it with button instead of alert function.

emugi
Posts: 19
Posted 17:27 Mar 18, 2017 |

But thank you so much for your reply though!!

msargent
Posts: 519
Posted 17:42 Mar 18, 2017 |

You can bring your laptop to my office hours and I'll take a look.