02.
<script type=
'text/javascript'
>
03.
$(window).load(
function
(){
04.
$(
"#new_form input"
).keyup(
function
() {
05.
var
css_klass, inpt;
06.
css_klass = $(this).attr(
"class"
);
07.
$(this).attr(
'value'
, $(this).val());
08.
inpt = $(this).val();
09.
return
$(
"."
+ css_klass +
"_preview"
).html(inpt);
10.
});
11.
});
12.
13.
</script>
14.
15.
16.
</head>
17.
<body>
18.
<form accept-charset=
"UTF-8"
action=
"/deals"
class
=
"new_deal"
data-abide=
""
id=
"new_form"
method=
"post"
novalidate=
"novalidate"
>
19.
20.
<label
for
=
"deal_title"
>Title of your offer <small>required</small></label><br>
21.
<input autocomplete=
"off"
class
=
"deal_title"
id=
"deal_title"
name=
"deal[title]"
required=
"required"
type=
"text"
data-invalid=
""
value=
"Test Value"
>
22.
<br>
23.
<input name=
"commit"
type=
"submit"
value=
"Create Deal"
>
24.
</form>
25.
26.
<div id=
"preview"
>
27.
<h6
class
=
"deal_title_preview"
></h6>
28.
</div>