顯示在同一頁面的結果我有node.js的快遞網絡應用,點擊一個按鈕執行CRUD操作。這裏我需要根據用戶的輸入更新記錄。爲此,我需要輸入用戶的詳細信息,在同一頁面顯示記錄的現有值,並提示用戶是否要更改數據。node.js的玉石 - 做一個POST請求,沒有重定向
如果是的話,那麼我需要輸入值,從用戶和更新。是否有可能在一個單一的玉文件中,我從用戶獲得輸入值。
玉文件:
extends ../layout
block content
.page-header
h3 Updation
form.form-horizontal(role='form', method='POST')
h4 Enter the employee id for which you want to update the details
input(type='hidden', name='_csrf', value=_csrf)
.form-group
label(class='col-sm-2 control-label', for='empid') Emp ID
.col-sm-2
input.form-control(type='text', name='empid', id='empid', autofocus=true)
.form-group
.col-sm-offset-2.col-sm-2
button.btn.btn-primary(type='submit')
i.fa.fa-pencil
| Get details
我有這個文件,其中我收到來自用戶的員工ID,使POST請求。我不確定如何將響應呈現給同一頁面本身並提示更改詳細信息。
任何幫助,將不勝感激。
我會嘗試你提到的方式。同時,如果你有相同的示例代碼,你可以發佈嗎? – Kirthika
謝謝妮可。對不起,遲到了。我一定會檢查一下:) – Kirthika