Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
 All Forums
 Dynamic HTML Editor
 Dynamic HTML Editor
 Form problem

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert Email Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Testa Posted - 02 Apr 2009 : 13:57:08
Hi, i've a problem with a form that i want send via mail.
The form contains 1 layer visible and 2 layers not visible, switchable between them, with only one active.
Every layer is inside the form recipient and contains some required field evaluate from a function call.
  • When i call the function that check required fields, i have different situation depending on browser used.
    With Mozilla browser all work well:
    - all fields in all layers (also not visible) are evaluate and the form is sent only if all required fields are ok.
    With IE after the message of "required field missing" in the non-visible layer, the form is sent always.

    Anyone can help me? I'd like that IE make the same situation of the Mozilla browser.


  • Besides in the field action of the form proprieties write "Send_Form.php" wich is the server side script for send the form. This script work well, but when sent form (by clicking "send" button) all browser load a blanck page named Send_Form.php.

    How can i make that browser don't open php page?


Thanks.
Regards, Stefano.[2 ??:-|]
3   L A T E S T    R E P L I E S    (Newest First)
Testa Posted - 04 Apr 2009 : 13:30:20
OK, i've the "solution".
I use the show command after check field and return false immediatly.
It's work great in all browser!!

Thanks a lot.
Testa Posted - 03 Apr 2009 : 16:34:56
I've a form named FormDatiAutoveicoli wich has three layers (1 visible and 2 non visible) , a PHP script named SendAutoveicoli.php and only one submit button inside form. When i click button i call a java function named checkForm.

Here the sample:
<form id="FormDatiAutoveicoli" name="FormDatiAutoveicoli" style="position: absolute; left: 35px; top: 36px;" action="SendAutoveicoli.php" method="post" onsubmit="return checkForm (this) ;">.

When click on submit button i have:
- Mozzilla: function make the right evaluation of all fields (also the field inside non-visible layers) and don't send any mail untill all required fields are not filled.
- IE: function make the right evaluation only of the fields inside active layer. When all fields inside visible layer are filled, on submit, appear a msg box that tell about the need to fill the first field of non-visible layer, but when i click ok button, send the form).

Now i try your second propose, but i don't understand why i have two different situation browser-depending.

Thanks,
Stefano T.
s.dav Posted - 03 Apr 2009 : 10:21:19
Probably you setup the form in a wrong way

The correct way to work with form is the following:

1- create one or more forms
2- put a "Submit" button into the form you want to send
3- in the "onSubmit" event of the form you have to return "false" for blocking the form to be sent to server or "true" to permit the form to be submitted to server

ex: <form onsubmit="return checkInput()" method="post" action="my.php">

Alternatively you can use simple buttons on forms (NOT submit buttons, because they submit the container form), manage their "onClick" event and raise a form submit when the data has been validated

ex:

if (checkInput()) myform.submit();

checkInput is a javascript function made by you that check for validation on your input fields and return false on error.

Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000