PHP Form Validation and Radio Group
Hi David,
I'm trying to set the initial state of a radio group to none.
Please look at the file http://ecopethandbags.com/contact.php. The initial state is set to "No"
In Dreamweaver, I've set the initial state to "Unchecked"
I don't understand the code for the radio buttons in my file (see attachment).
What I am trying to do is to have the radio group initially unchecked but required.
I have 2 questions:
1) - How can I control the initial status of the radio group when I use the PHP form validation?
2) - How can I set the validation so, when one of the radio buttons is not checked by the user, a warning flag like "Please make a choice" comes up.
Thank you much!
Just change the following section of code:
<?php
if (!$_POST || isset($missing) && $_POST['subscribe'] == 'n') {
echo 'checked="checked"';
} ?>
Remove the !$_POST || like this:
<?php
if (isset($missing) && $_POST['subscribe'] == 'n') {
echo 'checked="checked"';
} ?>
The checked="checked" will be inserted into the code only if the form has been submitted, but neither radio button has been selected.
Similar Messages
-
PHP Form Validation and Insert Records
Hi There,
I've been scratching my head for 2 days and couldn't find a solution.
Here is my problem:
Go to http://ecopethandbags.com/contactTest.php and click the "Send Comments" button.
You will see that the validation works.
Now, go to http://ecopethandbags.com/contactTestInsert.php, this time, I've inserted the "Insert Record" server behavior.
Click the "Send Comments" button again.
You will see the ugly message like "Column 'firstname' cannot be null" in a plain white page.
My question is:
How can I insert the PHP form records in my database and take advantage of the form validation nicely like in http://ecopethandbags.com/contactTest.php
I am attaching the files.
Thank you for you help!boloco wrote:
My question is:
How can I insert the PHP form records in my database and take advantage of the form validation nicely like in http://ecopethandbags.com/contactTest.php
Use simple PHP logic to merge the scripts together.
Dreamweaver automatically puts the Insert Record server behavior code at the top of the script. You need to adapt it so that the validation is done first. If the validation succeeds, use the Insert Record server behavior. If not, redisplay the form.
if (array_key_exists('send', $_POST)) {
// validate the form input
if (!$suspect && empty($missing)) {
// send the mail
if ($mailSent) {
unset($missing);
// insert the Insert Record server behavior code here -
Need help with PHP form with checkboxes, radio buttons and file attachment
Hi guys,
I'm having a nightmare with this PHP form where a user can fill it in, attach a doc/pdf and submit. After trying to sort it out with previous code I've used, I've stripped it out and think I should just start again in the hope you geniuses can help!
Here is the HTML of contact.php:
<form action="" method="post" name="contact" id="contact">
<p>Job Title:*<br />
<input name="position" type="text" /></p>
<p>Nationality:*<br />
<select name="nationality">
<option value="">-- select one --</option>
<option value="Afghan">Afghan</option>
<option value="Albanian">Albanian</option>
<option value="Algerian">Algerian</option>
<option value="Zambian">Zambian</option>
<option value="Zimbabwean">Zimbabwean</option>
</select>
</p>
<p>Which country are you currently living in?*<br />
<select name="country">
<option value="">-- select one --</option>
<option value="United Kingdom">United Kingdom</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Africa">Africa</option>
<option value="Zambia">Zambia</option>
<option value="Zimbabwe">Zimbabwe</option>
</select>
</p>
<label class="radio" for="checkRight">Yes/No question?</label><br />
<input class="radio" type="radio" name="right" value="Yes" /> Yes
<input class="radio" type="radio" name="right" value="No" /> No
<input class="radio" type="radio" name="right" value="N/A" /> Not applicable
<p>Yes/No question?<br />
<select name="continue">
<option value="">-- select one --</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
</p>
<p>Select your resorts:<br />
Resort 1<input name="res1" type="checkbox" value="Resort 1" />
Resort 2<input name="res2" type="checkbox" value="Resort 2" />
Resort 3<input name="res3" type="checkbox" value="Resort 3" />
Resort 4<input name="res4" type="checkbox" value="Resort 4" />
Resort 5<input name="res5" type="checkbox" value="Resort 5" />
Resort 6<input name="res6" type="checkbox" value="Resort 6" />
</p>
<p>Don't send form unless this is checked:* <input type="checkbox" name="parttime" value="Yes" /></p>
<p>Date of arrival: <input name="arrive" id="datepick" /><br />
Date of departure: <input name="depart" id="datepick2" /></p>
<script type="text/javascript" src="assets/scripts/datepickr/datepickr.js"></script>
<link href="assets/scripts/datepickr/datepickr.css" rel="stylesheet">
<script type="text/javascript">
new datepickr('datepick');
new datepickr('datepick2', {
</script>
<p>Name:*<br />
<input name="name" type="text" /></p>
<p>E-mail:*<br />
<input name="email" type="text" /></p>
<p>Telephone:*<br />
<input name="telephone" type="text" class="ctextField" /></p>
<p>Upload CV (Word of PDF formats only):<br />
<input type="file" name="cv" class="textfield"></p>
<p><input name="submit" value="Submit Enquiry" class="submitButton" type="submit" /><div style="visibility:hidden; width:1px; height:1px"><input name="url" type="text" size="45" id="url" /></div></p>
</form>
By the way, the date boxes work so excuse the Javascript in there!
To prevent SPAM I've used a trick where there's a hidden URL field which must be left blank for the form to submit which you can see in the PHP.
Below is where I'm at with the PHP which is placed above the header of contact.php...
<?php
if (array_key_exists('submit', $_POST)) {
$position = $_POST['position'];
$arrive = $_POST['arrive'];
$nationality = $_POST['nationality'];
$parttime = $_POST['parttime'];
$depart = $_POST['depart'];
$name = $_POST['name'];
$email = $_POST['email'];
$telephone = $_POST['telephone'];
$to = "[email protected]";
$subject = "Recruitment Application";
$message = $headers;
$message .= "Name: " . $_POST["name"] . "\r\n";
$message .= "E-mail: " . $_POST["email"] . "\r\n";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= 'From: My Website <[email protected]>' . "\r\n";
$message= "
$url = stripslashes($_POST["url"]);
if (!empty($url)) {
header( 'Location: http://www.go-away-spam-robots.com' );
exit();
if (!isset($warning)) {
mail($to, $subject, $message, $headers);
header( 'Location: http://www.mywebsite.co.uk/sent.php' );
?>
I would like to make pretty much all the field compulsory so if a field is left empty (other than the hidden URL field), a warning message is displayed next to that field.
Also I would like the file upload field to attach to the email that is sent to me and have the results come through to me in a table format.
Can anyone help me get my form working?
Thank you and I hope to hear from you!
SMHi Nancy,
Great stuff, thank you for the reply.
I've managed to get the Formm@iler working and running as I need it to.
The only thing I'm struggling with is when the user clicks submit, they are taken to a page of whatever results the form returned but it is just a white background with Times New Roman text.
How can I have it so the user is taken to the form results in the websites' page layout?
I tried sending them to a generic 'thank you' page by adding the following code but it just took them there whatever the results of the form so that's no good...! I have a feeling it's a bit more complicated than that...
header( 'Location: http://www.nofussbus.co.uk/test/sent.php' );
Thank you for your help! -
Trouble validating a radio group
So I created a form with some text fields and a text area. I
highlighted the submit button and then went to add a behavior to
"validate form". I was able to make the text fields I wanted
required.
Later I had to go back and add a radio group. However, when i
try to add the radio group as required, I do not see it listed on
the validate form behavior. Even if I delete the existing validate
form behavior and create a new one, I do not see the radio group
listed amongst the text fields so I can't make it required.
How come my radio group is not listed? How can I make it
required on the form? Thanks.DW validation does not validate radio buttons. Try yaromats
free extension - it works well. -
I am a new web designer who is not code savey yet. Anyway
during the various sites i have designed i have used 3 different
forms that process and email it to me using a seperate php form, 1
in flash, 2 from a standard html form on a windows server. All have
been uploaded, to the site, tested and worked fine. 2 are in old
sites, one in my current site. Recently all 3 forms stopped working
and while they looked like they worked fine they no longer actually
sent anything. I had a big email arguement with my host and finally
they added this line into my php script "ini_set
("sendmail_from","[email protected]");" email address is example here
and they added another form to my site called "php4-cgi-fcgi.ini."
Then my curent form started working again. I haven't changed
anything, and of course the host never informed me of any changes.
So why did this need to be added for my form to work again? Does
this mean they upgraded to another version or something? Ihad a big
arguement with them because they refused to tell me what they did
that stopped all my forms from working, they kept acting like it
was me or my provider that caused the problem, when i am positive
we were not the problem. Any thoughts?doing a google on "ini_set ("sendmail_from" gives a lot of
info.
summary- the form script you are using is probably not
setting a default
"FROM" email address, so the host has phpmail() reject it as
possible spam
abuse.
The .ini files the host added to your site correct the
problem. They change
values for php to use within your hosting domain.
What php script are you using to send the emails? It is
probably out of date
if it doesn't address this issue.
Off Topic: suggest never arguing with hosting support. Even
it the person at
the other end of the phone is an 18 year old drone not
earning their salt.
Move the site if needed. Develop social engineering skills to
get things
done.
Alan
Adobe Community Expert, dreamweaver
http://www.adobe.com/communities/experts/ -
PHP Form Validation: Radio Buttons
Hey everyone -
I'm trying to do two things here with an addition to one of
my forms using
PHP.
1. Attempting to validate if one of the radio buttons has
been selected.
2. Displaying which radio button is selected once the page is
reloaded
(checking for validation errors). That is - if they've
selected a radio
button but didn't fill in the other area - I want the radio
button they've
already selected to be actually "selected" once the page
reloads.
Here is the series of radio buttons:
<input type="radio" name="subject" id="subject1" value="1"
/>
<label for="subject1" class="labelbold">I wish to
contact you regarding
website design</label><br />
<input type="radio" name="subject" id="subject2" value="2"
/>
<label for="subject2" class="labelbold">I wish to
report a technical
error</label><br />
<input type="radio" name="subject" id="subject3" value="3"
/>
<label for="subject3" class="labelbold">I wish to
report an error with the
copy</label><br />
<input type="radio" name="subject" id="subject4" value="4"
/>
<label for="subject4"
class="labelbold">Other</label><br />
This is how I'm validating my checkboxes:
if($_POST['confirmbox'] == false) $error[] = "Check the
Privacy Policy
Agreement Box";
However, using "false" doesn't seem to matter with the radio
buttons. So,
how can I get the radio buttons to validate that ONE was
selected and how
can I show that selected button on a page reload (I'm
thinking I may need to
dynamically generate the value=""....<?php...?>....?).
Thanks!
Shane H
[email protected]
http://www.avenuedesigners.com
=============================================
Proud GAWDS Member
http://www.gawds.org/showmember.php?memberid=1495
Delivering accessible websites to all ...
=============================================Hello there -
After no replies - I decided to strain my brain (ha-ha) - and
finally
figured out the solution to the problem.
For the curious - I added this to each <input...>
field:
<?php if($_POST['subject'] == "1") echo'
checked="checked"';?>
And then for each <input...> I changed the "1" to the
corresponding value
each field was given.
Have a wonderful night. :)
Shane H
[email protected]
http://www.avenuedesigners.com
=============================================
Proud GAWDS Member
http://www.gawds.org/showmember.php?memberid=1495
Delivering accessible websites to all ...
=============================================
"Shane H" <[email protected]> wrote in
message
news:[email protected]...
> Hey everyone -
>
> I'm trying to do two things here with an addition to one
of my forms using
> PHP.
>
> 1. Attempting to validate if one of the radio buttons
has been selected.
>
> 2. Displaying which radio button is selected once the
page is reloaded
> (checking for validation errors). That is - if they've
selected a radio
> button but didn't fill in the other area - I want the
radio button they've
> already selected to be actually "selected" once the page
reloads.
>
> Here is the series of radio buttons:
>
> <input type="radio" name="subject" id="subject1"
value="1" />
> <label for="subject1" class="labelbold">I wish to
contact you regarding
> website design</label><br />
>
> <input type="radio" name="subject" id="subject2"
value="2" />
> <label for="subject2" class="labelbold">I wish to
report a technical
> error</label><br />
>
> <input type="radio" name="subject" id="subject3"
value="3" />
> <label for="subject3" class="labelbold">I wish to
report an error with the
> copy</label><br />
>
> <input type="radio" name="subject" id="subject4"
value="4" />
> <label for="subject4"
class="labelbold">Other</label><br />
>
> This is how I'm validating my checkboxes:
>
> if($_POST['confirmbox'] == false) $error[] = "Check the
Privacy Policy
> Agreement Box";
>
> However, using "false" doesn't seem to matter with the
radio buttons. So,
> how can I get the radio buttons to validate that ONE was
selected and how
> can I show that selected button on a page reload (I'm
thinking I may need
> to dynamically generate the
value=""....<?php...?>....?).
>
> Thanks!
>
> --
> Shane H
> [email protected]
>
http://www.avenuedesigners.com
>
> =============================================
> Proud GAWDS Member
>
http://www.gawds.org/showmember.php?memberid=1495
>
> Delivering accessible websites to all ...
> =============================================
>
>
> -
Clearing a Form or Radio Group on Click of a Button
Hi Experts,
I have a simple VC model which has BI Query as Data service and a Form is connected to it.
Form will be populated based on the input to the BI Query.
I have Few Input Fields, Drop Downs, Date files and Radio Groups in that form.
I have included two buttons 1. Clear whole form, 2. Clear Radio Group
I was able to clear whole form by giving some garbage value to one of the fields.
But didnt find any way to clear only Radio Group.
Kindly let me know how can i reset only Radio Group in the above form.
Regards,
Rk.Hi Jayant Kulkarni
Please go through this link
http://en.allexperts.com/q/Javascript-1520/disable-part-radio-button-1.htm
Please reward points if useful -
Dynamic Action not triggering on Radio Group change
I have a form that contains a text item, a radio group item and a display-only item. I have created a single dynamic action "CHANGE SUBJECT" associated with both the text and radio group items that updates the display-only item's value whenever either is changed. The action fires properly when the text item is changed, but not when the radio group is changed. If I set the radio group item's "Page Action when Value Changed" property to "Redirect and Set Value", than everything works, but that is not the desired behavior as that requires a refresh of the entire page. Any suggestions on how to make this action work? Is there a different action for the radio-group that I should be using instead of CHANGE? Thanks for your help.
-Jeff
Edited by: jritschel on Sep 1, 2010 2:05 PMOK, then change it to JavaScript Expression instead of SQL and put this code in the value :
"Radio Group Value= "+ $v('P65_RADIO_GROUP')+" - Text Box Value= "+ $x('P65_TEXT').value I tried it and it work!
Sam
Update:
I tried the same code you had before (plsql Expression) but there is something that you need to do to make it work, in the TRUE action setting , there is a "Page Items to Submit" field, you need to put your text item and radio in it as follows:
Page Items to Submit : P65_RADIO_GROUP,P65_TEXTThis should make your code work in addition to the other way I provided.
Thanks,
Sam
Edited by: Sam_06 on Sep 1, 2010 2:27 PM -
I used this script
http://www.visibilityinherit.com/code/php-form-validation.php
to produce a form and everything worked fine on my site, which I
was using for testing. When I transferred over to the client's site
it doesn't send the email. The error and thank you messages work,
but no email. As I have heard that some hosts block some php files
with the name 'formmail' I called it something else.
I have checked and rechecked all the data and only my email
address and the URLs for the error and thank you pages had to be
changed, my email is correct, but still not email.
Any ideas as to what is happening and how I can get around it
please?
RosalindI have been sent the following information and code, but have
not succeeded in working out where to add it. The code I am using
is underneath. Many thanks
- to send emails through our servers you must comply with one
of the following rules
a. The sending email must be from your domain
b. The receiving email must be from your domain
This account could/should be [email protected]
- To avoid a wrong use of our scripts by spammers you must
had a line before you call the “mail” functionality
ini_set("sendmail_from", " [email protected] ");
- Please add to the email send code a functionality
“-f” in the fifth parameter of the function send mail
- This is the simple configuration of sending emails in php
<?php
ini_set("sendmail_from", [email protected]);
mail($email_to, $email_subject, $email_message, $headers,
'-f'[email protected]);
?>
my php code is
<?php
// Input Your Personal Information Here
$mailto = '[email protected]' ;
$from = "FormosaParadise.com" ;
$formurl = "
http://formosaparadise.com/correios.php"
$errorurl = "
http://formosaparadise.com/formmailerror.php"
$thankyouurl = "
http://formosaparadise.com/thankyou.php"
// End Edit
// prevent browser cache
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "
GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
function remove_headers($string) {
$headers = array(
"/to\:/i",
"/from\:/i",
"/bcc\:/i",
"/cc\:/i",
"/Content\-Transfer\-Encoding\:/i",
"/Content\-Type\:/i",
"/Mime\-Version\:/i"
if (preg_replace($headers, '', $string) == $string) {
return $string;
} else {
die('You think Im spammy? Spammy how? Spammy like a clown,
spammy?');
$uself = 0;
$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" :
"\n" ;
if (!isset($_POST['email'])) {
header( "Location: $errorurl" );
exit ;
// Input Your Personal Information Here
$name = remove_headers($_POST['name']);
$email = remove_headers($_POST['email']);
$phone = remove_headers($_POST['phone']);
$comments = remove_headers($_POST['comments']);
$http_referrer = getenv( "HTTP_REFERER" );
// End Edit
if
(!preg_match("/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i",$email))
header( "Location: $errorurl" );
exit ;
// Input Your Personal Information Here
if (empty($name) || empty($email) || empty($phone)
||empty($comments)) {
header( "Location: $errorurl" );
exit ;
// End Edit
if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
header( "Location: $errorurl" );
exit ;
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
// sets max amount of characters in comments area (edit as
nesesary)
if (strlen($comments) > 1250) {
$comments=substr($comments, 0, 1250).'...';
// End Edit
$message =
"This message was sent from:\n" .
"$http_referrer\n\n" .
// Input Your Personal Information Here
"Name: $name\n\n" .
"Email: $email\n\n" .
"Phone No: $phone\n\n" .
"Comments: $comments\n\n" .
"\n\n------------------------------------------------------------\n"
// End Edit
mail($mailto, $from, $message,
"From: \"$name\" <$email>" . $headersep . "Reply-To:
\"$name\" <$email>" . $headersep );
header( "Location: $thankyouurl" );
exit ;
?> -
I have a very basic PHP form coded and whenever I look at it in Live View the bottom third of the processing code appears at the top of the webpage. Uploaded the code does not appear on the webpage and the form works fine, except that the dropdown initial values I have set are ignored.
The form URL: http://affordableroofingcontractors.com/contact-us.php
The dropdown code: (I want "select one" displayed but the form shows "Re-roofing" instead!?)
<select name="service" id="service">
<option value="0" selected="selected"
<?php if (!$_POST ||$_POST['service'] =='0') {
echo 'selected="selected"'; }?>>--select one--</option>
<option value="Proactive Roof Maintenance"
<?php if (!$_POST ||$_POST['service'] =='Proactive Roof Maintenance') {
echo 'selected="selected"'; }?>>Proactive Roof Maintenance</option>
<option value="Roof Repairs"
<?php if (!$_POST ||$_POST['service'] =='Roof Repairs') {
echo 'selected="selected"'; }?>>Roof Repairs</option>
<option value="Re-roofing"
<?php if (!$_POST ||$_POST['service'] =='Re-roofing') {
echo 'selected="selected"'; }?>>Re-roofing</option>
</select>
The processing code:
<?php
if (array_key_exists('submit', $_POST)){
//mail processing script
// remove escape characters from POST array
if (PHP_VERSION < 6 && get_magic_quotes_gpc()) {
function stripslashes_deep($value) {
$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
return $value;
$_POST = array_map('stripslashes_deep', $_POST);
if (!empty($_POST['area'])) {
$to = '[email protected]';
$subject = 'SUSPECTED BOT SUBMISSION from ACI quote form';
} else {
$to = '[email protected]';
$subject = 'ACI CONTACT FORM';
//list expected fields
$expected = array('name','company','phone','email','service','building','comments');
//set required fields
$required = array('name','email','phone');
//create empty array for any missing fields
$missing = array();
//assume there is nothing suspect
$suspect = false;
//create a pattern to locate suspect phrases
$pattern = '/Content-Type:|Bcc:|Cc:/i';
// function to check for suspect phrases
function isSuspect($val, $pattern, &$suspect) {
// if the variable is an array, loop through each element and pass it recursively back to the same function
if (is_array($val)) {
foreach ($val as $item) {
isSuspect($item, $pattern, $suspect);
else {
// if one of the suspect phrases is found, set Boolean to true
if (preg_match($pattern, $val)) {
$suspect = true;
//check the Post array and any subarrays for suspect content
isSuspect($_POST, $pattern, $suspect);
if ($suspect) {
$mailSent = false;
unset($missing);
} else {
//process POST variables
foreach ($_POST as $key => $value){
//assign to temporary variable and strip whitespace if not an array
$temp = is_array($value) ? $value : trim($value);
//if empty and required, add to $missing array
if (empty($temp) && in_array($key, $required)) {
array_push($missing, $key);
} elseif (in_array($key, $expected)) {
//otherwise, assign to a variable of the same name as $key
${$key} = $temp;
//validate the email address
if (!empty($email)) {
// regex to identify illegal characters in email address
$checkEmail = '/^[^@]+@[^\s\r\n\'";,@%]+$/';
//reject the email address if it doesn't match
if (!preg_match($checkEmail, $email)){
$suspect = true;
$mailSent = false;
unset($missing);
//go ahead only if not suspect and all required fields OK
if (!$suspect && empty($missing)) {
//build the message
$message = "Name: $name\r\n\r\n";
$message .= "Company: $company\r\n\r\n";
$message .= "Phone: $phone\r\n\r\n";
$message .= "Email: $email\r\n\r\n";
$message .= "Service Needed: $service\r\n\r\n";
$message .= "Type of Building: $building\r\n\r\n";
$message .= "Comments: $comments";
//limit line length to 70 characters
$message = wordwrap($message, 70);
//create additional headers
$headers = "From: $email>\r\n";
$headers .= 'Content-Type: text/plain; charset=utf-8';
if (!empty($email)) {
$headers .= "\r\nReply-To: $email";
//send it
$mailSent = mail($to, $subject, $message, $headers);
if ($mailSent) {
//$missing is no longer needed if email is sent, so unset it
unset($missing);
?>Hi!
To select php form you should create a menu, fill out the type of "choice of one item of many" or "Select multiple items from the many." Must be inside FORM element and have at the start or end tags. It contains several elements OPTION, otherwise it makes no sense.
Example:
<HTML> <body>
<form method='post' action='all.php'>
Color Scheme: <br>
<SELECT NAME="color">
<OPTION VALUE="Standard" SELECTED> </ OPTION>
<OPTION VALUE='Brick'> Brick </ OPTION>
<OPTION VALUE='Gray Mouse'> Gray Mouse </ OPTION>
<OPTION VALUE='Ship Bottom'> Ship Bottom </ OPTION>
<OPTION VALUE='Black Night'> Black Night </ OPTION>
<OPTION VALUE='White Light'> White Light </ OPTION>
<OPTION VALUE='Yellow List'> Yellow List </ OPTION>
<OPTION VALUE='Pink Myth'> Pink Myth </ OPTION>
<OPTION VALUE='Green USD'> Green USD </ OPTION>
<OPTION VALUE='Standard'> Standard </ OPTION>
</ SELECT>
<input type='submit' name='submit' value='go'>
</ form>
</ body> </ HTML>2 -
Update XML files with a PHP form...
Hi,
I would like to know if its possible to update or insert data
to XML files from a PHP form? And how can I do it? Basically i want
to create a backoffice for my XML Flash slide show.
Can anyone help me?Indirectly, I suppose. In that you'd have to handcode
verything. There's
nothing built-in to DW to accomplish this task. The simplest
way of doing it
is to use the FSO to write out the XML to an XML file.
Jules
http://www.charon.co.uk/charoncart
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004 -
Why is HTML showing in the form validation message?
Here is what is showing when I use server side form validation.
<ul><li>You must select a location </li></ul> Go <a href="javascript:history.back()">back</a> and correct the problem.
Obviously, the HTML tags are not supposed to be shown. What's going on here? I just upgraded to CF9 on Linux and this started happening. Any ideas?It's a standard CF server-side form validation and looks like this on the form:
<input type="hidden" name="somefield_required" value="some field is a required field">
When they submit the form (and didn't enter something for somefield), the automatic message comes up. The formatting of the message is messed up on CF9. I've been using this type of server-side validation for years (probably since CF5) and have never seen this problem before.
Actually, this works fine on another server (CF 9,0,0,251028) but on CF 9,0,1,274733 it is having this issue. Both are running CF Enterprise on Linux.
Error message is supposed to look like this:
Form entries are incomplete or invalid.
some field is a required field
Go back and correct the problem.
The messed up message looks like this:
Form entries are incomplete or invalid.
<ul><li>some field is a required field</li></ul> Go <a href="javascript:history.back()">back</a> and correct the problem. -
Help with java form validation script needed
Please, check my source text. I'm trying to get some simple
alerts to prevent my form from submitting if vital fields are
incomplete but the fom submits no matter what. My eyes are blurry
from trying to figure this out!
http://www.creativerealtynetwork.com/listing.html
Thank you!here is the code for the OK btn
on (press)
ErrorMessage = "";
name = Edit1;
if (name == "")
ErrorMessage = "Enter your Name";
} // end if
phone = Edit2;
if (phone == "")
ErrorMessage = "Enter your phone";
} // end if
email = Edit3;
if (email == "")
ErrorMessage = "Enter your email";
} // end if
if (email.indexOf("@", 0) < 0)
ErrorMessage = "Enter valid email";
} // end if
if (email.indexOf(".", 0) < 0)
ErrorMessage = "Enter valid email";
} // end if
contact = Edit4;
if (contact == "")
ErrorMessage = "Enter your message";
} // end if
message = "mailto:[email protected]?subject=Thank you for
contacting
us&body=Form contents%0A";
message = message + "name: " + name + "%0A";
message = message + "phone: " + phone + "%0A";
message = message + "email: " + email + "%0A";
message = message + "contact: " + contact;
if (ErrorMessage != "")
getURL(message, "_self");
} // end if
I get a error message only for the email if not filled
correctly,
thank you
"ldlouis" <[email protected]> wrote in message
news:gp9qit$4ad$[email protected]..
> Hi all
>
> I news using flash 8 I'm trying to build a form
validation and I cant get
> it to work.
>
> here is a copy of the fla file
>
>
http://www3.sympatico.ca/ralix/test1.fla
>
> Thank you -
Accordion with integrated form validation
I am working on another widget. It's based on Spry's
Accordion and it have
built-in form validation. You can see it in action here:
http://www.massimocorner.com/libraries/spry/accordionform/sample.htm
Massimohere is the code for the OK btn
on (press)
ErrorMessage = "";
name = Edit1;
if (name == "")
ErrorMessage = "Enter your Name";
} // end if
phone = Edit2;
if (phone == "")
ErrorMessage = "Enter your phone";
} // end if
email = Edit3;
if (email == "")
ErrorMessage = "Enter your email";
} // end if
if (email.indexOf("@", 0) < 0)
ErrorMessage = "Enter valid email";
} // end if
if (email.indexOf(".", 0) < 0)
ErrorMessage = "Enter valid email";
} // end if
contact = Edit4;
if (contact == "")
ErrorMessage = "Enter your message";
} // end if
message = "mailto:[email protected]?subject=Thank you for
contacting
us&body=Form contents%0A";
message = message + "name: " + name + "%0A";
message = message + "phone: " + phone + "%0A";
message = message + "email: " + email + "%0A";
message = message + "contact: " + contact;
if (ErrorMessage != "")
getURL(message, "_self");
} // end if
I get a error message only for the email if not filled
correctly,
thank you
"ldlouis" <[email protected]> wrote in message
news:gp9qit$4ad$[email protected]..
> Hi all
>
> I news using flash 8 I'm trying to build a form
validation and I cant get
> it to work.
>
> here is a copy of the fla file
>
>
http://www3.sympatico.ca/ralix/test1.fla
>
> Thank you -
Important form validation regression
Hi,
Using ADF Faces/Trinidad + ADF Data Bindings + ADF Business Components.
I was experimenting with task flows vs transaction control vs form validation and met an important regression in 11G.
To reproduce, build a simple form with a commit button. Make sure one of the field displayed in the form is bound to an entity attribute with a simple validation (like a length validation). Run the form (edit a row) and follow these steps:
1- Edit the field value mentioned above and make sure the value will fail the validation;
2- Press the commit button;
3- Server returns an error message;
4- DON'T fix the error, but modify another field value and make sure the value will pass the validations;
5- Press the commit button;
6- Server does not return an error. Commit is successful. Value in error is rollbacked to the original value?!?!?!?!?!??
Reproduced with two applications. The first one was built from scratch with 11G. The second one was built in 10.1.3.3 and migrated to 11G. For your information, in 10G it worked perfectly!
Thanx!
OlivierPlease email me a 10.1.3 sample application (removing the adf-faces-impl.jar and jsf-impl.jar) to keep the size down. Thanks. ([email protected])
Please make your file be a *.jar or *.zipp extension since our email rejects *.zip files.
Also, it would be helpful if you include a URL to this forum posting in your email for back-reference.
Maybe you are looking for
-
How do I transfer purchases in iTunes 12
I finally figured out how to look at the device, my iPhone. with that silly icon row across the top. I went to do a full back up of my phone and found two issues. One is a gui oversight.. can't really call it a bug.. just a cancel or exit is missing
-
ITunes does not delete songs -- Send song files to the Trash for deletion
27May2012 Apple Support: I have Itunes on an external drive. I put the (song) files on another external drive for storage becasue the itunes drive is full. After copying the files, I tried to delete the songs. I had the option to keep the files or
-
I was upgrade to SQL Server 2012 and Visual Studio 2010 was upgraded with SP1 the same day. This is x64 machine. Microsoft SQL Server Management Studio 11.0.2100.60 Microsoft .NET Framework 4.0.30319.261 Operating System 6.1.7601 Pro
-
Importing HDV material error message
This is my workflow. I have shot some footage with my Sony z1 in 1080/50i (I work on the PAL format). I want to down convert this with my camera and edit in FCP 5.0.4. I am using a Power Mac g5 quad. How should I import this into fcp? What should my
-
Problem in converting varchar to timestamp
Hi all, I'm having one varchar column which has data like, 2008-08-01T12:00:16.000000+00:00 i need to extract '2008-08-01 12:00:16' and put into an timestamp solumn. How can this be done. i tried the below query, SELECT to_date((to_date((SUBSTR((REPL