jQuery Impromptu、特に $.prompt インライン フォームのコールバック関数に問題があります。
さて、実際の具体的な問題は次のとおりです。送信時にフィールドが空白の場合は機能email_address
しませんが、$.prompt('Please supply an email address for the customer')
変更すると機能しalert('Please supply an email address for the customer')
ます。
$.prompt
他の呼び出しはコールバック関数内にあるため、期待どおりに機能するため、これはスコープの問題であると推測してい$.post
ます。
e
コールバック フォーム機能の膨大な量のドキュメントを見つけるのに苦労しました。変数、v
およびf
変数を理解しているように感じますが、 m
(Message) は以前に使用したものではありません。コンソール ログに記録m
すると、jQuery Impromptu オブジェクトのように見えますが、そのプロパティにアクセスする方法がわかりません。試してみm.prompt()
まし$.m.prompt()
たが、これらはprompt
関数にアクセスする方法についての推測にすぎません。
Javascript
var txt = '<input type="text" name="email_address" value="" />';
function mycallbackform(e,v,m,f)
{
if(v != undefined)
{
if (v == true)
{
console.log(f);
if (f.email_address.length == 0)
{
console.log(m);
$.prompt('Please supply an email address for the customer');
}
else
{
$.post('". $this->view->url(array(), 'admin-create-user-from-checkout') ."', f, function(data) {
if(data.status)
{
$.prompt('Customer Record Created Successfully');
}
else
{
$.prompt('Customer Record could not be created');
$('#email_address').val($('#old_email_address').val());
}
}, 'json');
}
}
else
{
$('#email_address').val($('#old_email_address').val());
}
}
$.prompt(txt,{callback: mycallbackform, buttons: { Ok: true, Cancel: false }});
のコンソール ログm
Object[div.jqimessage]
0
div.jqimessage
context
undefined
jquery
"1.7.2"
length
1
prevObject
Object[div#jqi_state_state0.jqi_state]
selector
".children(#jqi) #jqi_st...0.children(.jqimessage)"
constructor
function()
init
function()
_toggle
function()
add
function()
addClass
function()
affix
function()
after
function()
ajaxComplete
function()
ajaxError
function()
ajaxSend
function()
ajaxStart
function()
ajaxStop
function()
ajaxSuccess
function()
alert
function()
andSelf
function()
animate
function()
append
function()
appendTo
function()
attr
function()
before
function()
bind
function()
blur
function()
button
function()
carousel
function()
change
function()
children
function()
clearQueue
function()
click
function()
clone
function()
closest
function()
collapse
function()
contents
function()
contextmenu
function()
css
function()
data
function()
dblclick
function()
delay
function()
delegate
function()
dequeue
function()
detach
function()
die
function()
domManip
function()
dropdown
function()
each
function()
empty
function()
end
function()
eq
function()
error
function()
extend
function()
fadeIn
function()
fadeOut
function()
fadeTo
function()
fadeToggle
function()
filter
function()
find
function()
first
function()
focus
function()
focusin
function()
focusout
function()
get
function()
has
function()
hasClass
function()
height
function()
hide
function()
hover
function()
html
function()
index
function()
innerHeight
function()
innerWidth
function()
insertAfter
function()
insertBefore
function()
is
function()
keydown
function()
keypress
function()
keyup
function()
last
function()
live
function()
load
function()
map
function()
modal
function()
mousedown
function()
mouseenter
function()
mouseleave
function()
mousemove
function()
mouseout
function()
mouseover
function()
mouseup
function()
next
function()
nextAll
function()
nextUntil
function()
not
function()
off
function()
offset
function()
offsetParent
function()
on
function()
one
function()
outerHeight
function()
outerWidth
function()
parent
function()
parents
function()
parentsUntil
function()
popover
function()
position
function()
prepend
function()
prependTo
function()
prev
function()
prevAll
function()
prevUntil
function()
promise
function()
prompt
function()
promptDropIn
function()
prop
function()
push
push()
pushStack
function()
queue
function()
ready
function()
remove
function()
removeAttr
function()
removeClass
function()
removeData
function()
removeProp
function()
replaceAll
function()
replaceWith
function()
resize
function()
revmaxslide
function()
revnext
function()
revolution
function()
revpause
function()
revprev
function()
revresume
function()
revshowslide
function()
scroll
function()
scrollLeft
function()
scrollTop
function()
scrollspy
function()
select
function()
serialize
function()
serializeArray
function()
show
function()
siblings
function()
size
function()
slice
function()
slideDown
function()
slideToggle
function()
slideUp
function()
sort
sort()
splice
splice()
stop
function()
submit
function()
swipe
function()
tab
function()
text
function()
toArray
function()
toggle
function()
toggleClass
function()
tooltip
function()
transit
function()
transition
function()
trigger
function()
triggerHandler
function()
typeahead
function()
unbind
function()
undelegate
function()
unload
function()
unwrap
function()
val
function()
waitForImages
function()
width
function()
wrap
function()
wrapAll
function()
wrapInner
function()
__proto__
Object[]