Hello,
I’m using the Carousel action to build some kind of a “multi-page” HTML form, where each “page” is a Carousel pane. The user can jump from one “page” to the next by clicking at a button (I did it as a Carousel text link).
Before moving to the next part of the form (aka the next Carousel pane), a JavaScript function is called verifying user’s input. If something is missing, an alert message is shown and the function returns false preventing the user to go to the next panel until he fixed his input.
So far the theory. But unfortunately it is not working.
The alert message will be shown as intended, but although false is returned as well, the next Carousel pane gets displayed.
Strangely when I replace the internal anchor link to an external one calling a website (or whatever), my script is working as intended (alert message AND not following the link).
I wonder if this is related in any way with the Carousel action ? But I fear that JavaScript is simply not supporting the onclick event on internal anchors as intended.
How can I solve this problem ? Is there an easy way to get form elements validated on a Carousel pane and only allowing the user to move to the next pane if anything has been filled in correctly ? Or shorter: How can I prevent following an internal anchor by using JavaScript ?
For your reference, here is some of my code used:
JavaScript validation function (it’s part of a larger file)
function VerifyShopContentSE6_en()
{
var f = document.forms[0];
if (f.elements["SE_ISSEO-0014_001_Website"].value == "")
{
alert("You must fill in this form field.");
return false;
};
};
Button code excerpt from the HTML document (I’m using a rollover effect in addition here); added some returns for better readability
<a href="#ShopContent7"
onclick="javascript:return VerifyShopContent6_de();"
id="text_tab_ShopContent7"
onmouseover="FWRestore(1,'Indigo'); ...
Basically this is a set of four images bound together the rollover effect. In order to make it to work, I added the following manually:
- Internal link: #ShopContent7 (it’s the next Carousel pane)
- onclick-Event: javascript:return VerifyShopContent6_de();
- id-Tag: Well, that was on waltd’s example for a Carousel text link; the Carousel is working without having that tag, but leaving it has no influence to my problem.
Well, much text to read But perhaps you can provide me with some insights; hopefully it’s just a small oversight by myself…
Tobias.
actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options