Jump to content

Changing text in a form


gerkintrigg

Recommended Posts

This is driving me bonkers!

 

I want to be able to dynamically change the value of a text field using this function:

 

function popup_blanket(ID2Delete)  
  {  
    document.getElementById("blanket").style.visibility = "visible"; 
document.getElementById("confirmation_centre_screen").style.visibility = "visible"; 
        //alert('ID: '+ID2Delete);
document.forms['DeletePageForm'].elements['Page2Delete'].value=ID2Delete;

  }  

 

Then I will simply call it using this link:

 

<a href="javascript: popup_blanket(<?php echo $rpages['page_id'];?>)"><img src="<?php echo $root;?>furniture/delete.jpg" alt="Delete This Page" width="30" height="30" border="0" title="Delete This Page" /></a>

 

The problem is that the value of the text box is not responding.

I have set up a test alert to check that the function is being called correctly (now commented out above) but that worked fine. What am I doing wrong?

Link to comment
https://forums.phpfreaks.com/topic/263987-changing-text-in-a-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.