Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rendelosch
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
DevTeam
Rendelosch
Commits
991f2b8f
Commit
991f2b8f
authored
1 year ago
by
László Mócsy
Browse files
Options
Downloads
Patches
Plain Diff
Create `CreateForm` page
parent
d53dfe31
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Rendelosch/Pages/CreateForm.cshtml
+56
-0
56 additions, 0 deletions
Rendelosch/Pages/CreateForm.cshtml
Rendelosch/Pages/CreateForm.cshtml.cs
+11
-0
11 additions, 0 deletions
Rendelosch/Pages/CreateForm.cshtml.cs
Rendelosch/Pages/Index.cshtml
+1
-1
1 addition, 1 deletion
Rendelosch/Pages/Index.cshtml
with
68 additions
and
1 deletion
Rendelosch/Pages/CreateForm.cshtml
0 → 100644
+
56
−
0
View file @
991f2b8f
@page
@using Rendelosch.Models
@model Rendelosch.Pages.CreateForm
@{
ViewData["Title"] = "CreateForm";
}
<div
class=
"container-lg mt-4"
>
<form
method=
"post"
>
<div
class=
"card"
>
<div
class=
"card-body d-flex flex-column"
>
<div
class=
"d-flex flex-row"
>
<label>
Űrlap neve:
</label>
<input
type=
"text"
class=
"ms-2"
/>
</div>
<div
id=
"fields"
class=
"mt-4 d-flex flex-column gap-2"
></div>
<div
class=
"d-flex flex-row mt-4 gap-2"
>
<input
type=
"text"
id=
"field_id"
placeholder=
"ID"
/>
<input
type=
"text"
id=
"field_name"
placeholder=
"Megnevezés"
/>
<button
type=
"button"
class=
"btn btn-outline-primary"
onclick=
"addField()"
>
Új mező hozzáadása
</button>
</div>
<div>
<input
class=
"btn btn-primary mt-4"
type=
"submit"
/>
</div>
</div>
</div>
</form>
</div>
<script>
function
addField
()
{
// Get input fields
const
input_id
=
document
.
getElementById
(
"
field_id
"
);
// ID of the field
const
input_name
=
document
.
getElementById
(
"
field_name
"
);
// Name of the field
const
fields
=
document
.
getElementById
(
"
fields
"
);
// Div for displayed fields
// Displayed field
const
field_div
=
document
.
createElement
(
"
div
"
);
field_div
.
innerHTML
=
"
<p class='mb-0'>
"
+
input_name
.
value
+
"
(ID:
"
+
input_id
.
value
+
"
)</p>
"
;
fields
.
appendChild
(
field_div
);
// Hidden input field for each created fields
const
field_hidden
=
document
.
createElement
(
"
input
"
);
field_hidden
.
type
=
"
hidden
"
;
field_hidden
.
name
=
"
fields
"
;
field_hidden
.
value
=
input_id
.
value
+
"
;
"
+
input_name
.
value
;
field_div
.
appendChild
(
field_hidden
);
// Clear input fields
input_id
.
value
=
""
;
input_name
.
value
=
""
;
}
</script>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Rendelosch/Pages/CreateForm.cshtml.cs
0 → 100644
+
11
−
0
View file @
991f2b8f
using
Microsoft.AspNetCore.Mvc.RazorPages
;
namespace
Rendelosch.Pages
;
public
class
CreateForm
:
PageModel
{
public
void
OnGet
()
{
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Rendelosch/Pages/Index.cshtml
+
1
−
1
View file @
991f2b8f
...
...
@@ -5,7 +5,7 @@
}
<div
class=
"container-lg"
>
<a
class=
"btn btn-primary my-4"
asp-page=
"Create
Product
Form"
>
Create Product Form
</a>
<a
class=
"btn btn-primary my-4"
asp-page=
"CreateForm"
>
Create Product Form
</a>
<div>
@{
foreach (var productForm in Model.Repository.GetProductForms())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment