Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.