Referencing bootstrap class in JQuery for ASP generated HTML -
my page uses asp (vbscript) generate div bootstrap class 'alert' upon successful sql submission. want happen - once user submits form , alert div appears, click on first input field of form, want alert div disappear. have feeling issue lies with:
a.) referencing div generated asp in jquery b.) referencing div multiple bootstrap classes c.) maybe i'm breaking golden rule knows , don't.
any appreciated. code below:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script> $(function(){ $("qname").click(function(){ $(".alert").hide(); }); }); </script> </head> <body> <!-- #include virtual="/navbar.asp" --> <section> <div class='container'> <div class='row well-lg'> <% if intstatus = 1 response.write("<div class='alert alert-success'><h3 class='text-center'>entry successful!</h3></div>") elseif intstatus = 2 response.write("<div class='alert alert-warning'><h3 class='text-center'>this query name exists! update existing entry?</h3></div>") end if %> <div class='text-center'> <h3>sql query entry</h3> <i>add sql statements used query search web tool.</i><br> </div><br> <form method="post" action="/webtools/queryadd.asp" class="form-horizontal" role="form" id="reportform"> <div class="form-group"> <label class="control-label col-sm-offset-2 col-sm-3" for="qname">query name: </label> <div class="col-sm-4"> <input type="text" class="form-control" id="qname" name="qname" placeholder="enter query name (60 char max)" <% if intstatus = 0 %>value="<%=request.form("qname") %>"<% end if %> maxlength="60" required> </div> ...........................................
you need use #
reference element it's id
$("qname").click(function(){
should be
$("#qname").click(function(){
Comments
Post a Comment