0

I have one datatable with edit and delete button, and when I click the edit button, it shows the popup window with input fields and values to edit. But what I need is one new page with input fields and value to edit. The following code is to show the popup window.

`<span><i class='fa fa-pencil fa-2x' onclick='edit(" + value.Id + ")' data-target='#ModalForUpdate' data-toggle='modal'></i></span>` 

This is the code to edit button in datatable. I am using this code in my JS file..

2 Answers 2

1

// You can use the get method to send value.

function edit(id){
  window.location.href = 'http://yourdomain.com/form?id='+id
}
Sign up to request clarification or add additional context in comments.

Comments

1

You can use session storage for this in your on click function you pass the id of the item, so you can set that id in session storage and redirect to the edit page like

function edit(edivalue){ sessionStorage.setItem('editvalue', editvalue); window.location.href="//Your edit page link";

And next you can use sessionStorage.getItem('editvalue') to get the value in Edit page

Try this

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.