dprasad
asked on
Calling php from javascript link
I need to display a php form yo make an update, but would like to do it underneath the current table within the same page like:
<a href = "#" onclick = "showedit();"return false;">Edit</a></div></td ></div></t d>
It should show a form with a submit button, any ideas?
<a href = "#" onclick = "showedit();"return false;">Edit</a></div></td
It should show a form with a submit button, any ideas?
if you need to get something from your server to do it, have the DIV load an iframe..
e.g.
linkObj.innerHTML = '<IFRAME src="www.microsoft.com/myform.php"></IFRAME>';
e.g.
linkObj.innerHTML = '<IFRAME src="www.microsoft.com/myform.php"></IFRAME>';
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you just want to make a one-way call to a php script, without getting anything back from the script, you can do this by loading a javascript "image". For example, if you want to pass the value "my_value" to the script "my_script.php" then you can do this:
<script>
img = new Image(1,1);
img.src = "http://www.example.com/my_script.php?my_parameter1=my_value";
</script>
Rangi
<script>
img = new Image(1,1);
img.src = "http://www.example.com/my_script.php?my_parameter1=my_value";
</script>
Rangi
You mean something like this:
http://www.modernmethod.com/sajax/sajax-0.10/php/example_wall.php
The page never refreshes.
It uses javascript to run a CHAT window.
:)
Here is the link to the source:
http://www.modernmethod.com/sajax/sajax-0.10/php/example_wall.php.txt
http://www.modernmethod.com/sajax/sajax-0.10/php/example_wall.php
The page never refreshes.
It uses javascript to run a CHAT window.
:)
Here is the link to the source:
http://www.modernmethod.com/sajax/sajax-0.10/php/example_wall.php.txt
Example:
<script type="text/javascript">
function showEdit(linkObj){
var obj = document.getElementById('e
if(obj.style.display=='non
obj.style.display='block';
linkObj.innerHTML = 'Hide edit';
}else{
obj.style.display='none';
linkObj.innerHTML = 'Show edit';
}
}
</script>
<table>
<tr><td>
<a href = "#" onclick = "showEdit(this);"return false;">Show edit</a><div id="editContainer" style="display:none">
<table border="0">
<tr><td><input type="submit" name="update"></td></tr>
<tr><td>Name:<td><input type="text" name="firstName" value="My name"></td></tr>
<tr><td>Address:<td><input
</table>
</div></td></div></td></tr
</table>