Hi, I have e script element for Javascript and one for jquery.
Please see below. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket=" http://wicket.apache.org/" lang="en" xml:lang="en"> <head> <style> input.colorValuesRed { color: red; border: 2px solid red; } input.colorValuesGrey { color: grey; border: 2px solid grey; } input.colorValuesGreen { color: green; border: 2px solid green; } div.paddedRight { padding-right: 10px; border-right: 1px solid #8D8D8D; } div.paddedLeft { padding-left: 10px; border-left: 1px solid #8D8D8D; position: relative; left: -1px; } </style> <script src=" https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> <script> $(function() { //var x = parseInt($('#cici').val()); //var tech = $.trim($('#technology-interf').val()); var tech; var setColor = function() { var tech = $.trim($('#technology-interf').val());//$('#technology-interf option:selected').text(); var value = parseInt($(this).val()); var what = (tech == '2G' && value == 4); if (tech == '2G') { $(this).toggleClass("colorValuesRed", (value == 4)); $(this).toggleClass("colorValuesGreen", (value == 1 || value == 2)); $(this).toggleClass("colorValuesGrey", (value == 3)); } if (tech == '3G') { $(this).toggleClass("colorValuesRed", (value > -95)); $(this).toggleClass("colorValuesGreen", (value < -97)); $(this).toggleClass("colorValuesGrey", (value <= -95 && value >= - 97)); } if (tech == '4G') { $(this).toggleClass("colorValuesRed", (value > -113)); $(this).toggleClass("colorValuesGreen", (value < -115)); $(this).toggleClass("colorValuesGrey", (value <= -113 && value >= -115)); } } //tech = $.trim($('#technology-interf').val()); var checkAll = function() { //tech = $.trim($('#technology-interf').val()); $("#rssi_table tbody tr td:last-child input").each(setColor); } $("#rssi_table tbody tr td:last-child input").change(setColor); $('#technology-interf').change(checkAll); checkAll(); }); </script> </head> <body> <wicket:extend > <script type="text/javascript"> var wasSubmitted = false; function checkBeforeSubmit(){ if(!wasSubmitted) { wasSubmitted = true; return wasSubmitted; } return false; } </script> On Thu, Jun 23, 2016 at 11:15 AM, Martin Grigorov-4 [via Apache Wicket] < ml-node+s1842946n4674958...@n4.nabble.com> wrote: > Hi, > > Wicket itself uses jQuery to do its work, so jQuery works with Wicket! :-) > > Make sure you don't have two <script> elements including jQuery in your > page. > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Thu, Jun 23, 2016 at 10:00 AM, Iamuser <[hidden email] > <http:///user/SendEmail.jtp?type=node&node=4674958&i=0>> wrote: > > > Hi, > > I'm using wicket 6. > > > > I have the following requirement: to change the color of some input > texts > > based on the value selected from a combobox and also on the values > entered > > in these input texts. > > > > For examble: > > *if I select 'A' and type 1 in the input text, the font color should be > > red. > > *if I select 'A' and type 10 in the input text, the font color should be > > green. > > > > *if I select 'B' and type 1 in the input text, the font color should be > > grey. > > *if I select 'B' and type 10 in the input text, the font color should be > > yellow. > > > > I have made a JQuery script, and everything works fine when loading the > > static html file. > > But when running the application and accessing this page, nothing works > > anymore. > > > > Do you have a hint on where to search for the problem? > > > > > > > > -- > > View this message in context: > > > http://apache-wicket.1842946.n4.nabble.com/jquery-does-not-work-in-wicket-tp4674957.html > > Sent from the Users forum mailing list archive at Nabble.com. > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [hidden email] > <http:///user/SendEmail.jtp?type=node&node=4674958&i=1> > > For additional commands, e-mail: [hidden email] > <http:///user/SendEmail.jtp?type=node&node=4674958&i=2> > > > > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://apache-wicket.1842946.n4.nabble.com/jquery-does-not-work-in-wicket-tp4674957p4674958.html > To unsubscribe from jquery does not work in wicket?, click here > <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4674957&code=c3VwZXJiaXNzaW1hQGdtYWlsLmNvbXw0Njc0OTU3fC01MzM2MjU4NzI=> > . > NAML > <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/jquery-does-not-work-in-wicket-tp4674957p4674959.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org