brown2005 Posted December 1, 2006 Share Posted December 1, 2006 Hi, What I want is say that i have this form<form method='post' action='2.php'> <input type='text' name='Item'> <input type='text' name='Item_value'></form>The i have a php page on the right that list say the playersItem 1 (4.5 Point)Item 2 (6.5 Point)What I want is say when they click on Item 1 link it puts Item 1 in the player input and 4.5 in Item_value..ne help please Link to comment https://forums.phpfreaks.com/topic/29113-php-with-javascript/ Share on other sites More sharing options...
alpine Posted December 1, 2006 Share Posted December 1, 2006 That is pure javascript, look at this:[code]<a onclick="javascript: document.getElementById('Item').value='insert this'">Click 1</a><a onclick="javascript: document.getElementById('Item_value').value='insert this in the other'">Click 2</a><form method='post' action='2.php'> <input type='text' name='Item' id='Item'> <input type='text' name='Item_value' id='Item_value'></form>[/code] Link to comment https://forums.phpfreaks.com/topic/29113-php-with-javascript/#findComment-133465 Share on other sites More sharing options...
brown2005 Posted December 4, 2006 Author Share Posted December 4, 2006 cool, but can you have it do two things..i mean when u click on link 1 can u have it enter 1 thing in box Item and another in Item_Valuei just tried<a onclick="javascript: document.getElementById('Item').value='insert this'; document.getElementById('Item_value').value='insert this'">Click 1</a>and it works, but is that the best way of doing it? Link to comment https://forums.phpfreaks.com/topic/29113-php-with-javascript/#findComment-134713 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.