close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Value does not show in products_update.php page after double quotation mark

Thread began 12/11/2013 8:05 am by joerg431091 | Last modified 12/12/2013 1:53 pm by joerg431091 | 2175 views | 10 replies |

joerg431091

Value does not show in products_update.php page after double quotation mark

I am sure it might be an easy fix but I can’t figure out why any text or value that comes after a double quotation mark does not appear in the update page.

For example: I have a size field that should have inch sizes such as 12.50” x 2.5” included. Works great to include with the insert page and appears as entered in the DB. But as soon as I try to update the product - the update page shows 12.50 and cuts everything off after the double quotation (inch) sign.

I thought it either has to do with the field setting in the DB or with the code on the products_update.php page.

Here is the code on the products_update.php page for this field:


<div class="lineGroup">
<label for="ProductSize" class="sublabel" > Size:</label>
<div class="errorGroup"> <span id="ProductSize_Spry"> <span>
<input id="ProductSize" name="ProductSize" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("productsupdate","ProductSize"):"".$row_WADAproducts["ProductSize"]."")); ?>" class="formTextfield_Medium" tabindex="5" onBlur="hideServerError('ProductSize_ServerError');">
<?php
if (ValidatedField('productsupdate','productsupdate')) {
if ((strpos((",".ValidatedField("productsupdate","productsupdate").","), "," . "5" . ",") !== false || "5" == "")) {
if (!(false)) {
?>
<span class="serverInvalidState" id="ProductSize_ServerError">Please enter a value.</span>
<?php //WAFV_Conditional products_update.php productsupdate(5:)
}
}
}?>
<span class="textfieldInvalidFormatMsg">Invalid format.</span><span class="textfieldRequiredMsg">Please enter a value.</span> </span> </span> </div>
</div>

Any help is appreciated.

Thx.

AJ

Sign in to reply to this post

Jason ByrnesWebAssist

in a form element, the value is enclosed by quotes, so the quote in the record is closing the value prematurly

change:
value="<?php echo((isset($_GET["invalid"])?ValidatedField("productsupdate","ProductSize"):"".$row_WADAproducts["ProductSize"]."")); ?>"

to:
value="<?php echo(str_replace("\", "&quot;", (isset($_GET["invalid"])?ValidatedField("productsupdate","ProductSize"):"".$row_WADAproducts["ProductSize"].""))); ?>"

Sign in to reply to this post

joerg431091

Thanks Jason - I am getting an syntax error as soon as I change the code. Might there be a typo in the code?

Sign in to reply to this post

Jason ByrnesWebAssist

sorry, value should be:
value="<?php echo(str_replace("\"", "&quot;", (isset($_GET["invalid"])?ValidatedField("productsupdate","ProductSize"):"".$row_WADAproducts["ProductSize"].""))); ?>"

Sign in to reply to this post

joerg431091

Awesome. That did it. Thanks so much Jason.

Best,
AJ

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

joerg431091

Sorry Jason - I was hoping you could also answer a follow up question:

How can I allow a fixed value that includes double quotation in a checkbox form? As an example, the following form includes the fixed value of 13.50 - 40 inches and I have to display it as follows:

<label>
<input type="checkbox" name="LeashLengthValue" value="13.50-40 in" id="LeashLengthValue_0">
</label>

I would prefer to have it entered as 13.5" - 40" but can not figure out how to do this with the double quotation.

Any hint is appreciated.

Thanks a lot.
Joerg

Sign in to reply to this post

Jason ByrnesWebAssist

use the &quot; html entity:


value="13.50-40 &quot;"

Sign in to reply to this post

joerg431091

Got this for the insert page. thanks a lot.

But I forgot to ask how am I going to check the value in the update or detail page then since the &quot is not recognized and the " not allowed.

<label>
<label class="checklabel" for="LeashLengthValue">
<input type="checkbox" name="LeashLengthValue" id="LeashLengthValue_0" value="13.50&quot;- 40&quot; (35-100cm)" class="formCheckboxField_Standard" <?php if (!(strcmp((isset($_GET["invalid"])?ValidatedField("productsupdate","Product_Hound_Leash_Length"):"".$row_WADAproducts["Product_Hound_Leash_Length"].""),"13.50&quot;- 40&quot; (35-100cm)"))) {echo "checked=\"checked\"";} ?>>
</label>

Thanks a lot.

Joerg

Sign in to reply to this post

Jason ByrnesWebAssist

Yeah, to be honest, i don't recommend using quotes in your data, whether they are encoded or not they cause more problems then they are worth, like you have found for validation. there really is not a good way to do this and have it validate properly.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...