0

I'm trying to build a data object in jade view page to my server side JS. it has dynamic html creation that inserts input boxes as user wants

function addDetail() { var detailHtml = '<tr><td width="55%"><input style="width:98%;" type="text" name="order.detail['+currentDetailCount+'].nam" /></td>' + '<td width="1%"><input type="checkbox" name="order.detail['+currentDetailCount+'].prc" /></td>' + '<td width="1%"><input type="checkbox" name="order.detail['+currentDetailCount+'].beg" /></td>' + '<td width="1%"><input type="checkbox" name="order.detail['+currentDetailCount+'].cut" /></td>' + '<td width="1%"><input type="checkbox" name="order.detail['+currentDetailCount+'].asb" /></td>' + '<td width="49%"><input style="width:98%;"type="text" name="order.detail['+currentDetailCount+'].msc" /></td></tr>'; $('tbody#detailAddTbody').append(detailHtml); currentDetailCount++; } 

and also have couple more fields in body

select(name='order.cname',id='cname') input(type='text', name='order.ordindate', id='ordindate') 

It seems like I can't retrieve 'order' object from my server side app.js. How can I pass dynamically built data object to server side?

1 Answer 1

1

You should use POST or GET method or Ajax(client side javascript) to send data to the nodejs server side

In Jade, it is only act as view in MVC model, you can't pass data from jade to nodejs.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.