2013年9月2日 星期一

jquery-submit (html save processing)

demo : http://hayageek.com/examples/jquery/form-submit/submit.html

jquery submit enable / disable


<script>$("#submit1").click(function(){
/*validation here*/
$("#inputForm").submit();
        function();
parent.function();
});</script>


jquery submit enable / disable


function enableSubmit(id) { $('input[id$="submit' + id + '"]').attr('disabled', false); }


jQuery Submit Form Example


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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
</head>
<body align="center">
<div align="center">
<h1>Jquery Form Submit Demo</h1>
<form name="myForm" id="testForm" method="POST" action="send.php">
UserName: <input type="text" name="user" value="test" /> <br/>
Password: <input type="password" name="password" value="test"/> <br/>
</form>
<br/>
<input type="button" id="submit1" value="Submit by Form ID" />
<input type="button" id="submit2" value="Submit by Form Name" />
<input type="button" id="submit3" value="Submit by Form Index" />
<input type="button" id="submit4" value="Submit with Event Handler" />
</div>
</body>
<script>
$(document).ready(function()
{
    $("#submit1").click(function()
    {
        $("#testForm").submit();
    });
    $("#submit2").click(function()
    {
        $("form[name='myForm']").submit();
    });
    $("#submit3").click(function()
    {
        $("form:first").submit();
    });
    $("#submit4").click(function()
    {
        $("#testForm").submit(function()
        {
         alert('Form is submitting');
         return true;
        });    
        $("#testForm").submit(); //invoke form submission
    });
});
</script>
</html>

click-or-dbclick open new window (bank / self)




click-or-dbclick open new window or not 

<a href="#" onclick="window.open('http://google.com/', '_blank')">Go_blank</a>;
<a href="#" onclick="window.open('http://google.com/', '_self')">Go_Self</a>;
<a href="#" ondblclick="window.open('http://google.com/', '_blank')">dblclick Go_blank</a>;


<a href="#" ondblclick="window.open('http://google.com/', '_self')">dblclick Go_Self</a>;

jquery-change-iframe-src example sample eg e.g.



change iframe src by jquey / javascript



<script>
$('#abc_frame').prop('src', 'NewFile.jsp')
</script>


<iframe width="100%" height="600"
name="abc_frame" id="abc_frame"
src="about:blank"
frameborder="0" >
</iframe>

2013年9月1日 星期日

html-new-open


window.open


function openNewWindow(url,mWidth,mHeight) {
_top=_top*1+numWindows*20;
_left=_left;
    numWindows += 1;
parameters = "toolbar=0,scrollbars=0,location=0,statusbar=0,"+
"menubar=0,resizable=0,width=mWidth,height=mHeight,top = 1 ,left =650 ";
var title = "Window #"+numWindows;
myWindow=window.open(url,'','location=false,width=400,height=300');
//myWindow=window.open(url);
myWindow.focus();  
}


call it :

openNewWindow('http://www.google.com',200,300);

java-parameter java-not-equal-null getParmeter not = null

java-parameter
getParmeter not = null

if (request.getParameter("keyValue") != null) {keyValue=request.getParameter("keyValue");}

Parameters allow a method to be generalized. That is, a parameterized method can operate on a variety of data and / or be used in a number of slightly different situations. To illustrate this point, consider the following very simple example. Here is a method that returns the square of the number 10:

int square(){return 10*10;}

While this method does, indeed, return the value of 10 squared , its use is very limited. However, if you modify the method so that is takes a parameter, as shown next, then can make square() much more useful.


int square(int i){return i*i;}