Link to home
Start Free TrialLog in
Avatar of AndyPSV
AndyPSVFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Jquery: alert() when submit with default value

how to put jquery script with message to change the default value for user (to the script below):

"<script>$(document).ready(function(){
alert ("helloworld");
});</script>"
<% if $display == 1 OR $_URL == $URL %>
	<script>$(document).ready(function(){$("#search").click(function(){$("#search_form").slideToggle("slow")})});</script>
	<script type="text/javascript">$(document).ready(function(){$("#bc").bind("change",function(){if(this.value=="1"){$("#c").attr("disabled",true)}else{$("#c").attr("disabled",false)}});$("#bc").change()});</script>
	<div id=search_form class='clear rel pad-left1 window<% if $display_show == '' %> none<% /if %>'>
	<form action=<% $URL %>catalogs/ method=GET name=searchform>
		<script>jQuery(function($){$("#t").Watermark("search\u00A0<% include file = $TPLx.'bl/if_search/index2.html' %>","#ccc")});</script>
			<input type=text name=t id=t size=54 />
			<% if $_URL == $URL %>
		  <select name=bc id=bc class=cc>
		  	<option value=''>&ndash;&nbsp;Select Category&nbsp;&ndash;</option>
		  	<% foreach from = $bc key = k  item = v %><option value=<% $bc[$k][id] %><% if $GET[bc] == $bc[$k][id] %> selected<% /if %>><% $bc[$k][t] %></option><% /foreach %>
		  </select>
		  <% /if %>
		  
			<select name=c id=c class=ccc<% if $_GET[0] == 'catalogs' OR $_GET[0] == '' %><% else %> disabled<% /if %>>
				<option value=''>&ndash; <% if $_GET[0] == 'catalogs' OR $_GET[0] == '' %><% else %>All&nbsp;<% /if %><% include file = $TPLx.'bl/if_search/index.html' %>&nbsp;&ndash;</option>
				<% foreach from = $c  key = k  item = v %><option value=<% $c[$k][id] %><% if $GET[c] == $c[$k][id] %> selected<% /if %>><% $c[$k][t] %></option><% /foreach %>
			</select>
			<a href=# onclick=document.searchform.submit(); class='fg-button button-small ui-state-default fg-button-icon-right ui-corner-all'>search</a>&nbsp; <a href=#>advanced search</a><br />
			<span class='bold'>Your recent searches:</span>&nbsp; <span class=dsc>none</span> <a href=#>AA</a>, <a href=#>ethanol</a>
	</form>
	</div>
	<% /if %>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of mstrelan
mstrelan
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AndyPSV

ASKER

Yes, could you give me the javascript code?
Avatar of AndyPSV

ASKER

answer not needed, thanks btw