Jump to content

strange problem


glenelkins

Recommended Posts

Hi

I am integrating an open source Javascript colour picker into a PHP project. All well and good when its supposed to work and does'nt!! Basically it pops up, you select the colour and it puts the colour code into a form field box.

Here is an example of the form page, this version works fine:


[code]
<form name="layout">
<table>
  <tr><td><input type="text" name="colour"></td><td><a href="javascript:TCP.popup(document.forms['layout'].elements['colour'])">Colour Picker</a></tr>
</table>
</form>
[/code]

The above works perfect (the javascript file is included in the head tags). But if I use the following it pops up the colour picker, but does not put the value into the box

[code]
<form name="layout">
<div>
<table>
  <tr><td><input type="text" name="colour"></td><td><a href="javascript:TCP.popup(document.forms['layout'].elements['colour'])">Colour Picker</a></tr>
</table>
</div>
</form>
[/code]

This is just a sample, the <div> is actually there for a reason in the real code, but why is this stopping the script from working?
Link to comment
https://forums.phpfreaks.com/topic/28732-strange-problem/
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.