Why Javascript won't work inside Shadowbox?

classic Classic list List threaded Threaded
4 messages Options
Kim
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Why Javascript won't work inside Shadowbox?

Kim
Hi,

I have a task where I need to manually reset field values of a form placed inside Shadowbox. After a load of headbanging and trying to figure out why does it not work, I downsized my ambitions to the following test form:

<a rel="shadowbox;" href="#inline-entry" onclick="document.testForm.testField.value='X';">Shadowbox

<div id="inline-entry" style="display:none;">
 <form id="testForm" method="post" name="testForm" target="_self">
 <input name="testField" id="testField" type="text"/>
 <input name="submit" type="submit" value="Submit" onclick="document.testForm.testField.value='Y';" />
 </form>
</div>

While a similar form *without* Shadowbox happily agreed to accept any value I wanted to place in its fields, this simple textbook exercise just won't work with a form in Shadowbox. Does anybody know a way to circumvent it?

(that is, if anybody still comes to this forum)
Kim
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Why Javascript won't work inside Shadowbox?

Kim
Ok, solution found. It seems, the problem wasn't about onClick not working, but about "document..." not being a viable way to access form fields inside Shadowbox. So far, only "this..." issued on form/field level seems to work.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Why Javascript won't work inside Shadowbox?

Ernestinriffith
In reply to this post by Kim
Yes, the areas are the same. My Perl CGI's are utilizing TT2 (Template Toolkit) so there are diverse wrappers and substance pages included, yet everything has the same area. The structure in the SB utilizes photo_wrapper.tt and a substance page called photo.tt. The SB is called from a page with an alternate wrapper and substance page ... in any case, this shouldn't make any difference, correct? Sadly, everything is behind a safe access region .

Get more professionals ideas from write my paper for cheap from online .
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Why Javascript won't work inside Shadowbox?

newtonmoses
In reply to this post by Kim
 I think in order to fix your problem, you need to have all directories from showbox.zip in the directory with the file showbox.js, because showbox adds other scripts to the page. I hope this will work out for you. You can get professional writing services by clicking on this link: Best Music Dissertation Helpers
Loading...