grails - Only perform onclick if field is blank -


I was thinking that someone could help me with any issue in Grates. I have a method that a user simply clicks on to read: textField which populates the field with the current user name, but I only need the method if textField is blank so that a user can access other users The user could not override the name if they already entered in.

Any suggestions? Thanks!

"post-text" itemprop = "text">

given

  & lt; This jQuery script should do  
  $ (' # name '). Click (function () {if (! $ (This) .val ()) send an AJAX request to get {var name = // username name (this) .val (name);}});   

Of course, you must also check on the server side that the username is empty

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -