Question : CREATE FUNCTION SQL

Hi All,

I try to create function below but failed.


How could I do it ?

Thank you.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
CREATE FUNCTION dbo.B_GET_FULLNAME 
(@MemberId nvarchar(7))
RETURNS varchar(100)
AS
BEGIN
declare @Return varchar(100)
set @return = select ISNULL(FullName, '') FROM TMMEMBERDATA WHERE MemberId = @MemberId
end

return @return
end

Answer : CREATE FUNCTION SQL

Here's a pretty simple mock-up of what (I think) you are trying to achieve.  The meat is the .after() and .next() functions of jquery.  $.after() allows you to insert something directions after a selected DOM element (in this case, your Start Date input).  $.next() will allow you to select the inserted <span> and remove it if validation passes.


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
<html>
      <head>
            <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">

			<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
            <style type="text/css">
                  * { font-family: Verdana; font-size: .97em; }


            </style>


      </head>

      <body>

			<input type="text" id="txt" Title="Start Date" />
			<button id="sub" type="submit" onclick="return validateForm()">Submit</button>
            <script>

				function validateForm() {
					var obj = $("input[title=Start Date]")
					if(!$(obj).val()) {
						$(obj).after("<span class='error'>Needed</span>");
						return false;
					} else {
						$(obj).next("span").remove();
						return true;
					}
				}

            </script>

      </body>
</html>
Random Solutions  
 
programming4us programming4us