modal ajax,Jquery jqmodal ajax support

I am making use of a modal on a site, and I am having trouble achieving something:

The modal I am using is jqModal found here: http://dev.iceburg.net/jquery/jqModal/

I have no issue initializing one modal.

$('#cartdialog').jqm({ajax:'@href',trigger: 'a.jqModalcart'});

});

viewcart.gif

alt="viewcart"/>

This will load up my main modal which displays the contents of cart2.php.

Here is the problem and I know there may be multiple solutions. cart2.php has a button on it, that I want the user to click and have the modal load new content from a different page (shipping.php). Preferably, it would swap out cart2.php for shipping.php, without the need of opening and closing modals, or nested modals that overlap the current one.

Further complicating the matter, shipping.php needs to be loaded with a zip code, which I have written a simple javascript validator for. The link that needs to be passed on looks like this:

href=("/ash/shop/shipping.php?zip=" + document.form9.zip.value)

I know I can get that link into the modal by initializing it like this:

$('#idhere').jqm({ajax:'@href',trigger: 'a.classhere'});

});

However, I cant seem to "trigger" a modal from a modal.

So I have many questions:

1)Can I leave one modal and change what is being loaded via AJAX inside of it (basically navigate to and from pages within one modal window)? IDEAL SOLUTION!!!!

2)If not...how can I create a nested modal that will show over top of the main modal AND load the link above which requires information from my zip code validator (I can give ajax:'linkhere') but my link has this part added to the end of it within the validator "+ document.form9.zip.value"

3)If that isnt possible...how can I make the button on the main modal FIRST close the main modal THEN load the secondary modal with the new content CONTAINING the link + zip

I have tried to provide this in the clearest way I can get it out of my brain. I will be happy to answer any questions about this as I completely understand I may have not been entirely clear

More info...I have tried .load() with no success but it is most likely because I have very little skill in this area. Here is my zip code script. I have it so that after 5 characters are entered, the link changes so that the user first sees"enter zip code" but then sees "calculate shipping" and the href changes as well.

function movepic(img_name,img_src) {

document[img_name].src=img_src;

}

function limitText(limitField, limitCount, limitNum) {

if (limitField.value.length == limitNum) {

limitField.value = limitField.value.substring(0, limitNum);

//switch image out

javascript:movepic('button','/ash/images/calculateshipping.gif');

//change image link

document.getElementById("tester").href=("/ash/shop/shipping.php?zip=" + document.form9.zip.value);

document.getElementById("tester").οnclick=function(){$('#cartdialog').load("/ash/shop/shipping.php?zip=" + document.form9.zip.value);};

} else {

limitCount.value = limitNum - limitField.value.length;

}

}

My HTML has a form...

Image

onKeyUp="limitText(this.form.zip,this.form.countdown,5);" maxlength="5">

Why can I not load the new page into the modal using the above?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值