-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform.html
executable file
·178 lines (150 loc) · 5.35 KB
/
form.html
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<div class="container">
<form role="form" method="get" class="well form-horizontal" id='mainform'>
<div class="control-group">
<label for="nc" class="control-label">No of concentrated Load</label>
<div class="controls">
<input type="text" name="nc" id='nc' placeholder="No of concentrated Load" />
<span class="help-block">Sample Input: 4</span>
</div>
</div>
<div class="control-group">
<label for="nu" class="control-label">No of UDL</label>
<div class="controls">
<input type="text" name="nu" id="nu" placeholder="No of uniformly distributed Load" />
<span class="help-block">Sample Input: 1</span>
</div>
</div>
<div class="control-group">
<label for="spanbeam" class="control-label">Span of Beam</label>
<div class="controls">
<input type="text" name="spanbeam" id="spanbeam" placeholder="Span of the beam" />
<span class="help-block">Sample Input: 5</span>
</div>
</div>
<div class="control-group">
<label for ="noseg" class="control-label">No of Segments</label>
<div class="controls">
<input type="text" name="noseg" id="noseg" placeholder="No of Segments" />
<span class="help-block">Sample Input: 5</span>
</div>
</div>
<div style="display: none" id="ncvariables">
<div class="control-group">
<label for="p" class="control-label">Intensity of concentrated Load</label>
<div class="controls" id='pcontrols'>
<span class="help-block">Sample Input: 2, 2, 3, 1</span>
</div>
</div>
<div class="control-group">
<label for="ac" class="control-label">Position of concentrated load measured from free end A</label>
<div class="controls" id='accontrols'>
<span class="help-block">Sample Input: 0, 1, 2, 4</span>
</div>
</div>
</div>
<div style="display: none" id="nuvariables">
<div class="control-group">
<label for="wu" class="control-label">Intensity of Uniformly Distributed Load</label>
<div class="controls" id='wucontrols'>
<span class="help-block">Sample Input: 2</span>
</div>
</div>
<div class="control-group">
<label for="au" class="control-label">Position of starting point of udl measured form starting point A</label>
<div class="controls" id='aucontrols'>
<span class="help-block">Sample Input: 1</span>
</div>
</div>
<div class="control-group">
<label for="lu" class="control-label">Length of UDL</label>
<div class="controls" id="lucontrols">
<span class="help-block">Sample Input: 2</span>
</div>
</div>
</div>
<div class="control-group">
<div class="controls">
<input type="submit" class="btn btn-primary" name="initialparameter" />
</div>
</div>
</form>
</div>
<script type="text/javascript">
$("#mainform").validate({
rules:{
nc: {
required: true,
number: true
},
nu: {
required: true,
number: true
},
noseg: {
required: true,
number: true,
range: [1,1]
},
spanbeam: {
required: true,
number: true
},
}
});
$("#nc").keyup(function(event) {
/* Act on the event */
if (isNaN(this.value))
{
this.value = 0;
}
if (parseInt(this.value)==0)
{
$("#ncvariables").hide();
}
//Create inputs accordingn to that
var pinput= $("<input type='text' name='p' value='0' />");
var acinput = $("<input type='text' name='ac' value='0' />");
//remove any previous inputs
$("#pcontrols").children("input").remove();
$("#accontrols").children("input").remove();
for (i=0; i<parseInt(this.value); i++)
{
$("<input type='text' id='p' name='p' value='0' />").appendTo('#pcontrols');
}
for (i=0; i<this.value; i++)
{
$("#accontrols").append("<input type='text' name='ac' id='ac' value='0' />");
}
$("#ncvariables").show();
});
$("#nu").keyup(function(event) {
/* Act on the event */
if (isNaN(this.value))
{
this.value=0;
}
if (parseInt(this.value)==0)
{
$("#nuvariables").hide();
}
var wuinput = $("<input type='text' name='wu' value='0' />");
var auinput = $("<input type='text' name='au' value='0' />");
var luinput = $("<input type='text' name='lu' value='0' />");
$("#wucontrols").children("input").remove();
$("#aucontrols").children("input").remove();
$("#lucontrols").children("input").remove();
for (i=0; i<this.value; i++)
{
$("<input type='text' id='wu' name='wu' value='0' />").appendTo('#wucontrols');
}
for (i=0; i<this.value; i++)
{
$("<input type='text' id='au' name='au' value='0' />").appendTo('#aucontrols');
}
for (i=0; i<this.value; i++)
{
$("<input type='text' id='lu' name='lu' value='0' />").appendTo('#lucontrols');
}
$("#nuvariables").show();
});
</script>