Topic: WA.Submit('form ID') in a separate JS Function

Hi!

great Framework - but now I've been trying for 2 days and I can't find any satisfying solution for my problem.

Before calling the WA-Submit() I have to check and manipulate the Form-Data (e.g. multiplications on numeric values, if-statements on the checkboxes, ...).
My idea: call a separate JS Function with the "onload" or "onclick"- Event-Handler. In this external JS function there should be the final WA-Submit() Call.

Problem:
The form will be submitted, but I can't return to the form. Every time I get back to the Home View.

The source code of the form:

    <div class="iLayer" id="waFormERR1" title="Test">
        <a href="#" rel="action" class="iButton iBAction" onclick="checkData('form3')">OK</a>
        <a href="#" rel="back" class="iButton iBClassic" onclick="return WA.Back()">Cancel</a>
        <form id="form3" action="/WRITEPI" method="POST" onsubmit="checkData(this)">

        <div class="iPanel">
            <div id="form-res"></div>
            <fieldset>
                <legend>Setpoint Values</legend>
                <ul>
                    <input type="hidden" name="ADR1" value="MW14"/>
                    <li><label>XS</label><input id="val1" type="text" name="VALUE1" value="333" /></li>
                    <input type="hidden" name="FORMAT1" value="%d"/>
                </ul>
            </fieldset>
    </div>

and the JS function:

            function checkData(anyform) {
                alert("Do something now... but after that stay on form3 !!!");
                WA.Submit(anyform);
            }

Thank you so much.

If there are other solutions please let me know.


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Re: WA.Submit('form ID') in a separate JS Function

You need to cancel the default event returning "false", so you code will be:

onsubmit="return checkData(this)"

and

function checkData(anyform) {
                alert("Do something now... but after that stay on form3 !!!");
                WA.Submit(anyform);
                return false;
}
We need Amazon reviewers. Please do one!
Book: "Beginning iPhone and iPad Web Apps: Scripting with HTML5, CSS3, and JavaScript" Buy Now! (or review).
/!\ Don't forget to "Like" WebApp.Net from the homepage

Re: WA.Submit('form ID') in a separate JS Function

Hi Chrilith,

it works! Nice that you are back again.

Here is the complete sample code for everyone else having the same problem:

    <div class="iLayer" id="waFormERR1" title="Test">
        <a href="#" rel="action" class="iButton iBAction" onclick="return checkData('form3')">OK</a>
        <a href="#" rel="back" class="iButton iBClassic" onclick="return WA.Back()">Cancel</a>
        <form id="form3" name="myform" action="/WRITEPI" method="POST" onsubmit="return checkData(this)">

        <div class="iPanel">
            <div id="form-res"></div>
            <fieldset>
                <legend>Setpoint Values</legend>
                <ul>
                    <input type="hidden" name="ADR1" value="MW14"/>
                    <li><label>XS</label><input id="val1" type="text" name="VALUE1" value="333" /></li>
                    <input type="hidden" name="FORMAT1" value="%d"/>
                </ul>
            </fieldset>
    </div>

and

     function checkData(anyform) {
          var f = document.myform;
          var val = f.VALUE1.value * 1;
          if (val < 100 || val > 400) {
               alert("Only values between 100...400 !!!");
               f.VALUE1.value = 333;
               //do not submit and stay on form
               return false;
          }
          //do submit and stay on form
          WA.Submit(anyform);
          return false;
     }

Thank you very much again.


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Re: WA.Submit('form ID') in a separate JS Function

swarovski outlet
air max 2018
ray ban glasses
pandora jewelry
soldier 11
puma outlet
air max 90
adidas yeezy
pandora cz
yeezy boost
lebron shoes
birkenstocks
pandora charms sale clearance
pandora gioielli
north face jackets
christian louboutin shoes
pandora charms
nike vapor max
adidas yeezy
moncler uk
christian louboutin shoes
nike trainers
pandora jewelry
yeezy boost
pandora
tory burch
ecco shoes
louboutin outlet
pandora canada
ugg outlet
timberland boots
skechers go walk
yeezy shoes
clarks shoes
nike shoes
adidas yeezy
ugg boots
hyperdunk
adidas shoes
polo ralph lauren
ecco shoes for men
cheap nike air max
fitflops sale clearance
adidas yeezy
pandora charms
coach black friday
katespade
yeezy boost
nike air max 270
moncler jackets
adidas yeezy
nmd adidas
fitflops
retro 12
ultra boost
north face canada
longchamp outlet
north face black friday deals
michael kors sacs
michael kors outlet
pandora jewelry
kyrie 3 shoes
pandora cyber monday
boty nike
new jordan
michael kors handbags black friday
ultra boost
coach outlet
yeezy
kyrie 3 shoes
longchamp
skechers outlet
adidas yeezy
calvin klein outlet
adidas ultra boost
nike air max 2018
coach handbags
michael kors handbags
kyrie 4
soccer shoes
yeezy boost
air max 97 gold
yeezy boost 350
louboutin outlet
coach outlet store online
anelli pandora
louboutin shoes
?perky pandora slevy
nike outlet
longchamp uk
fake rolex watches
yeezy boost
win like 96
pandora charms
pandora bracelets
timberland outlet
christian louboutin outlet
timberland
birkenstock outlet
ralph lauren factory store
yeezy boost 350
hermes handbags
coach outlet online
golden goose
skechers outlet online
pandora jewelry
fit flops
coach black friday
north face outlet jackets
jordan 11 gym red
canada goose jackets
adidas yeezy boost
air max 270
polo ralph lauren outlet online
pandora sale
anelli pandora
yeezy boost
longchamp outlet
cartier ring
skechers
adidas yeezy
pandora jewelry
air max 97
north face black friday deals
fit flops
yeezy sneakers
nike air max 2018
yeezy boost 350 v2 zebra
louboutin
pandora jewelry
nike outlet online
birkenstock sandals
yeezy
air presto
pandora bracelets clearance
nike vapor max
pandora bijoux
uggs|ugg uk|ugg boots uk}
coach handbags
red bottom shoes
the north face canada
kate spade wallets
fitflops
nike clearance store
pandora charms sale
kd 9
nike black friday deals
michael kors outlet
nike air vapormax
lacoste pas cher
timberland black friday deals
air max pas cher
nike shoes
jordan sneakers
nike outlet online
yeezy shoes
moncler official
timberland boots
nike outlet store
nike clearance store
jordan shoes for men
pandora
birkenstock
nike air max 270
woolrich
curry basketball shoes
curry 3
nike air max 97
pandora charms
nike huarache
jordan retro
mbt shoes
supreme hoodie
michael kors outlet
nike vapor max
adidas outlet
balenciaga sneakers
ecco shoes for women
bracelet pandora
canada goose pas cher
nike outlet store
nike air max 97
yeezy
adidas outlet online
balenciaga shoes
ralph lauren outlet
yeezy boost
converse outlet
nike air max 97
christian louboutin shoes
longchamp handbags
air max 2018
north face cyber monday
ferragamo belt
timberland shoes
red bottoms
adidas yeezy
pandora soldes
curry 5 shoes
jordan shoes


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/24/d260627385/htdocs/chrilith.com/forums/include/parser.php on line 738

Re: WA.Submit('form ID') in a separate JS Function

pandora
red bottoms for men
reebok outlet
jordan 4

doudoune canada goose
coach handbags
jordan shoes
air max plus
skechers australia
nike shoes
kate spade purses
louboutin shoes
uggs|ugg uk|ugg boots uk}
pandora bracelet
pandora outlet online
yeezys
mbt sandals
yeezy boost 350 v2
nmd
valentino shoes
tory burch sale
adidas soccer cleats
nike schuhe
coach wallets
discount ray-ban eyeglasses
pandora necklace
north face jackets for women
tory burch sandals
nike air vapormax flyknit
michael kors cyber monday
adidas yeezy zebra
michael kors handbags
birkenstock sandals
air max 97
pandora charms
longchamp handbags
jordan retro 11
ugg black friday
coach outlet
adidas yeezy boost
nike shoes
ultra boost 4.0
ralph lauren polo
hogan sito ufficiale
louboutin chaussures
north face clearance
adidas yeezy boost 350
adidas outlet store
christian louboutin shoes
nike clearance store
pandora cz
pandora rings official site
polo outlet online
timberland boots for women
pandora rings
air max 2017
ugg slippers
ecco
north face black friday deals
nike air max 270
the north face
kate spade outlet
nike clearance
clarks outlet
north face clearance
ralph lauren factory store
coach factory outlet
air max plus
north face jackets
kyrie 4 confetti
Amulette de Cartier Bracelet
oakley glasses
mbt shoes clearance outlet
red bottoms louboutin
north face jackets
north face jackets for women
pandora sale
nike air max
ugg slippers
goyard
puma fenty
skechers outlet
vapormax flyknit
nike vapor max
pandora
air max 2018
oakley
beats wireless headphones
coach outlet
adidas store
longchamp outlet store
hogan
woolrich parka
vapormax nike
ugg australia
adidas yeezy
adidas yeezy
soccer shoes
birkenstock outlet stores
adidas yeezy boost
nmds
kate spade handbags
red bottoms
blue tint yeezy
pandora cyber monday
pandora jewelry 70 off clearance
skechers sale
nike air max
pandora charms sale clearance
adidas yeezy
adidas yeezy
pandora bijoux
under armour cyber monday
nike clearance outlet
lacoste pas cher
fitflops sale clearance
nike outlet
uggs official site
soccer cleats
canada goose jackets
Cartier clou Necklace
ralph lauren
new jordans 2018
puma fenty
yeezy boost 350
ray-ban sunglasses
pandora
replica watches for sale
goyard outlet
michael kors canada
under armour shoes
sunglasses for women
huaraches nike
adidas superstar shoes
pandora rings
canada goose
barbour coats
adidas shoes
pandora charms
swarovski crystal
nike outlet store online shopping
off white
nike factory store
soccer cleats
jordan sneakers
valentino outlet
yeezy boost 350
jordan 12s
yeezy boost
christian louboutin red soles
skechers outlet online
nike outlet store
pandora
pandora jewelry
pandora jewelry official site
yeezy boost 350 v2
pandora charms
ecco shoes uk
pandora
soccer cleats
north face jacket
pandora charms cyber monday
balenciaga triple s
retro 12
under armour cyber monday
coach cyber monday
pandora black friday sale
air max 95 black
philipp plein instagram
adidas black friday specials
north face jackets black friday
coach outlet store online
clarks boots
christian louboutin shoes
pandora jewelry official site
christian louboutin uk
yeezy boost
yeezy boost
longchamp
ugg outlet online
canada goose jacket
ugg slippers
ecco shoes
chaussure nike
michael kors outlet online
hilfiger outlet
yeezy beluga 2.0
jordan 11
adidas ultra boost
moncler
birkenstocks
vapormax
pandora jewelry
nike air max
tory burch handbags
michael kors outlet
nike factory store
nike outlet store online shopping
air max 270