Our site’s UI displays read-only text fields which have mouse-click handlers — when the user clicks one of the read-only fields, we change its CSS to make the text and background color of that item appear “selected.”
If the user clicks a ‘show item’ button on this same page, the next page needs to ‘know’ which item was selected on the page that it was redirected from.
PAGE A: user clicks a read-only field to select it; the selection is highlighted via CSS
………and user can click a ‘Show Item’ button on this page to see the details of the selected item — we redirect to Page B to show the selected item’s details. The ‘Show item’ will NOT be a form ‘submit’ button, just a standard button.
PAGE B: Gets redirected to. Needs to know what item on Page A was the selected item (using the item’s ID or value etc.)
How? If you are inclined to say ‘Ajax’ don’t bother, I do not have that in my allowed suite of options, nor jquery, those are my marching orders.
The onclick handler is client-side code on Page A. The redirection is via window.location=”page2.php”
I do not see any way that Page A can make Page B aware of the selected item’s name or ID or etc. — it’s not a form post, it’s all client side code.
Although I might be missing something, pls let me know if I am. I’m stuck right now.
Reaching for straws, I thought of calling submit() but I don’t think I can pass anything that way
that would allow Page B to know which item on Page A was selected, besides the fact that submit()
requires A-Form.submit() and the ‘Show Item’ button is not on a form on Page A.
capture the click event and return the target’s id. pass the target’s id as a url param on the redirect.