Hi, I am very much aware about the submit process of form element and used many times isset($_POST[‘…’]) to check it.
Now, I have php form that contains 5 divs and a href tag, for one Name and i the same way I have N names as per database.
I want that when some one click on the Name div the corresponding pages with name as name.php should open and display the corresponding values on the page as per fetched name.
I knw that how to implement it with form submit as:
read the first page value via POST method and open change the location to the name.php page with read string and use Get method to read the global variable in name.php page and display the corresponding values on the name.php page …
But, how to achieve it with tag a href or div click
or
How to convert the N names block to button or input type submit??? I think this is yuk …
I don’t fully understand what you are trying to accomplish but this shows how you can use jQuery to POST after a click on a div using data stored within the div itself.
Hi, Many Thanks for various methods…
with Jquery Ajax post request, the problem cannot be resolved because this method send request to page.php and will get something in return and I will be on the same way in this way…
as I dont want to come back… means…
When I click on image or on a div I want to read the name or id of clicked image or div and generate the URL and change the location to another php page. with the passed variable and reterive it on another page by GET method.
I’m surprised that works with no action parameter in the form, or is there some JS somewhere that grabs the click? And my dev console says you’ve got two elements with the same id, which also might not help.
ETA - if I run that link from IE, clicking on either of the destinations just re-draws the initial page. If I do the same from Chrome, clicking on a destination opens the list of packages for that destination.
There doesn’t need to be an action attribute. If you are trying to target itself, then using no action attribute apparently “works”. Though this is invalid HTML since the validator will complain about it.