Author Topic: Use original form for update  (Read 8328 times)

0 Members and 1 Guest are viewing this topic.

Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
Re: Use original form for update
« Reply #15 on: October 19, 2011, 08:01:48 PM »
I am confused. i did it and it looks really fine - for filling our the form and editing the ad in a nice template with CSVupdate.
but when I open the CSVedit, i get there all the html codes....

Offline Jason

  • Administrator
  • Hero Member
  • *****
  • Posts: 1018
    • slipdex
Re: Use original form for update
« Reply #16 on: October 20, 2011, 04:21:45 AM »
Hi Shlomit,

The CSV Edit script is intended only for admin users, not for general user access. The CSV Edit template is a standard template, there is no customization to it. If you want to be able to see the text formatted, then you would have to create your own admin section of your site using the CSV Update script and customized templates. Just password protect it with .htaccess.

Jason
Founder of www.slipdex.com

Offline jovianakinn

  • Newbie
  • *
  • Posts: 1
Re: Use original form for update
« Reply #17 on: February 29, 2012, 12:56:42 AM »
Thanks for the responses but I need to know if there is a way to configure this in Visual Web Developer using the built in tools and wizards?

Thanks!

Offline Jason

  • Administrator
  • Hero Member
  • *****
  • Posts: 1018
    • slipdex
Re: Use original form for update
« Reply #18 on: March 02, 2012, 03:35:10 PM »
I'm not familiar with visual web developer. Going tips on how to work with a specific software is hard. If you simply mean a WYSIWYG then that have nothing to do with the backend part of the scripts so I'm not sure I understand your issue.
Founder of www.slipdex.com

Offline BrandonMark

  • Newbie
  • *
  • Posts: 1
Re: Use original form for update
« Reply #19 on: March 14, 2012, 07:45:22 AM »
I m working on orginal form and try to update it..

Offline Paul

  • Hero Member
  • *****
  • Posts: 162
Re: Use original form for update
« Reply #20 on: February 28, 2014, 06:54:56 PM »
Getting back to Shlomit's problem with the unwanted <br> tags in the textarea in the csv read template.

These may be removed with javascript (example below)

Code: [Select]

<textarea name="test" id="whatever"></textarea>

<script>
var info = "[[textarea_info]]";

br_strip = info.replace(/<br\s*\/?>/mg,"\r\n"); //replace <br> tags with \r\n

document.getElementById("whatever").value=br_strip;
</script>



Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
Re: Use original form for update
« Reply #21 on: March 01, 2014, 07:50:41 AM »
OMG this is what i was looking for. I use the wysiwyg script but i hate it when people paste there text with html tags and sometimes it looks awful, plus this script is not good for mobile phones. so what you did is great for me.

unfortunately i tested it now and every time i updated the text in the ad, it disappear from the filed......

is this correct ?

<textarea name="textarea3" id="Details" rows="10" cols="49">[[Details]]</textarea>

<script>
var info = "[[textarea_info]]";

br_strip = info.replace(/<br\s*\/?>/mg,"\r\n"); //replace <br> tags with \r\n

document.getElementById("whatever").value=br_strip;
</script>

Thanks Paul
« Last Edit: March 01, 2014, 08:18:15 AM by shlomit »

Offline Paul

  • Hero Member
  • *****
  • Posts: 162
Re: Use original form for update
« Reply #22 on: March 01, 2014, 04:52:30 PM »
This should work Shlomit ...

Quote
<textarea name="textarea3" id="Details" rows="10" cols="49">[[Details]]</textarea>

<script>
var info = "[[Details]]";

br_strip = info.replace(/<br\s*\/?>/mg,"\r\n"); //replace <br> tags with \r\n

document.getElementById("Details").value=br_strip;
</script>


Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
Re: Use original form for update
« Reply #23 on: March 01, 2014, 05:51:45 PM »
Hi Paul

it does not work...... when opening the template to update the ad, i can see the <br> and actually all the html tags
and when i am trying to edit the text, after saving it, ALL the text disappear :)

« Last Edit: March 01, 2014, 05:56:10 PM by shlomit »

Offline Paul

  • Hero Member
  • *****
  • Posts: 162
Re: Use original form for update
« Reply #24 on: March 01, 2014, 06:38:13 PM »
Can you paste your template code here Shlomit?


There must be a small problem somewhere...

Offline Paul

  • Hero Member
  • *****
  • Posts: 162
Re: Use original form for update
« Reply #25 on: March 01, 2014, 06:49:12 PM »
Oh ... I just realised. Try this ...

Code: [Select]
<textarea name="textarea3" id="Details" rows="10" cols="49"></textarea>

<script>
var info = "[[Details]]";

br_strip = info.replace(/<br\s*\/?>/mg,"\r\n"); //replace <br> tags with \r\n

document.getElementById("Details").value=br_strip;
</script>


(I removed the [[Details]] from between the textarea tags.)

Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
Re: Use original form for update
« Reply #26 on: March 02, 2014, 06:39:22 AM »
Hi Paul

sorry but still not ok. now when i enter the template even without trying to change anything the test area is empty :)
here is the code of the template

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="he-il" lang="he-il">

<HEAD>
<meta http-equiv="Content-Language" content="he">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<TITLE></TITLE>

<base target="_self">

<style type="text/css">
body
{
background-image:url('../../images/bgimage.png');
background-attachment:fixed;
}
</style>

</HEAD>

<body topmargin="0" leftmargin="0"  rightmargin="0" bottommargin="0" link="#003300" vlink="#005E00" alink="#C0C0C0" style="font-family: arial; font-size: 9pt;" text="#003300">
<template>

<p><a name="Top"></a></p>

<div align="center">
   <table width="900" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
      <tr>
         <td>


<!--webbot bot="Include" U-Include="../../headers/top-11.htm" TAG="BODY" --></td>
      </tr>
      <tr>
         <td>
         <table cellpadding="0" cellspacing="0" width="100%" bgcolor="#FFFFFF">
   <!-- MSTableType="nolayout" --><div align="center">

  <table border="0" width="100%" cellspacing="0" cellpadding="0">
   <tr>
      <td valign="top" style="font-family: verdana,arial; font-size: 11px">
      <div align="right">
         <table border="0" width="100%">
            <tr>
               <td><div align="right">

  <table border="0" cellspacing="0" width="66%" cellpadding="0" dir="rtl">

    <tr>

      <td width="98%">

      &nbsp;</td>

    </tr>

    <tr>

      <td width="98%">

      &nbsp;</td>

    </tr>

    <tr>

      <td width="98%">

      <p align="right" dir="rtl">
      <b><font face="Arial" style="font-size: 11pt">עריכת מודעת לוח חקלאי</font></b></td>

    </tr>

    <tr>

      <td width="98%">

      &nbsp;</td>

    </tr>

    <tr>

      <td width="98%">

      <p align="right" dir="rtl"><b><font size="2" color="#990000" face="Arial">
      *&nbsp; השדות המסומנים הינם שדות חובה</font></b></td>

    </tr>

    </table>

  </div></td>
            </tr>
            <tr>
               <td>

  <div align="right">



  <table border="0" cellspacing="0" width="100%" cellpadding="0">

    <tr>

      <td>
     


<FORM action=http://www.israel.agrisupportonline.com/buysell/csv/csvupdate-2.pl method=POST  ENCTYPE="multipart/form-data" target="_top">

<input type="hidden" name="action" value="save">
<input type=hidden name="ID" value="[[ID]]">







  <div align="right">

  <table border="0" cellpadding=0 width="100%">

    <tr>

      <td width=705 align=top>

        <div align="center">

        <table class="MsoNormalTable" border="0" cellspacing="1" style="mso-table-layout-alt: fixed; mso-padding-alt: 0cm 3.5pt 0cm 3.5pt" width="100%">

          <tr style="mso-yfti-irow:0">

            <p align="right">&nbsp;</td>

          </tr>

         

          <tr>

            <td valign="bottom">

            <p align="right">&nbsp;<input type="checkbox" name="ez_csv_delete_it" value="yes"><td valign="middle">&nbsp;</td>
          </tr>

         

          <tr>

            <td align="right" dir="rtl" height="42"><font size="2">

            <input type="text" name="Email" size="32" dir="ltr" style="border: 1px solid #800000" value="[[Email]]"></font></td>

            <td dir="rtl" height="42">

            <p align="right" dir="rtl">

            <font color="#004600" size="2" face="Arial"><b>דואר אלקטרוני</b></font></td>

          </tr>

          <tr>

            <td align="right" dir="rtl"><font size="2">

            <input type="text" name="Name" size="32" dir="rtl" value="[[Name]]"></font></td>

            <td dir="rtl">

            <p align="right" dir="rtl">

            <b>

            <font face="Arial" size="2" color="#004600">שם איש/אשת קשר</font></b><font face="Arial" size="2" color="#990000"> </font>

         </td>

          </tr>

          <tr style="mso-yfti-irow:0">

            <td align="right" dir="rtl">  <textarea id="textarea4" name="Company" style="overflow:hidden; font-family:arial" cols="36" rows="1">[[Company]]</textarea></td>

            <td dir="rtl">

            <p align="right" dir="rtl">

            <b>

            <font face="Arial" size="2" color="#004600">שם החברה או המשק&nbsp;</font></b><font face="Arial" size="2" color="#990000"> </font>

         <b>

            <font face="Arial" size="2" color="#D58000">&nbsp;</font></b></td>

          </tr>

          <tr style="mso-yfti-irow:0">

            <td align="right" dir="rtl"><font size="2">

            <input type="text" name="Website" size="32" dir="ltr" value="[[Website]]"></font></td>

            <td dir="rtl">

            <p dir="rtl"><b><font face="Arial" size="2" color="#004600">אתר&nbsp;אינטרנט</font></b></td>

          </tr>

          <tr style="mso-yfti-irow:0">

            <td align="right" dir="rtl"><font size="2">

            <input type="text" name="Phone" size="32" dir="ltr" value="[[Phone]]"></font></td>

            <td dir="rtl">

            <p align="right" dir="rtl">

            <font color="#004600" size="2" face="Arial"><b>טלפון</b>&nbsp; 1</font></td>

          </tr>

          <tr>

            <td align="right" dir="rtl"><font size="2">

            <input type="text" name="Mobile" size="32" dir="ltr" value="[[Mobile]]"></font></td>

            <td dir="rtl">

            <p align="right" dir="rtl">

            <font color="#004600" size="2" face="Arial"><b>טלפון</b> 2</font></td>

          </tr>

          <tr>

            <td align="right" dir="rtl">  <textarea id="textarea7" name="City" style="overflow:hidden; font-family:arial" cols="36" rows="1">[[City]]</textarea></td>

            <td dir="rtl">

            <font face="Arial" size="2" color="#004600">עיר/ישוב&nbsp; </font>

            <font face="Arial" size="2" color="#D58000"><b>

            * </b>&nbsp;</font></td>

          </tr>

         

          <tr>

            <td valign="middle" align="right"><font size="2">

            <input type="text" name="Classified" size="46" dir="rtl" value="[[Classified]]"></font></td>

            <td valign="top" dir="rtl">
         <p align="right"><font face="Arial" size="2" color="#004600">סיווג&nbsp;
         </font>

            <font face="Arial" size="2" color="#D58000"><b>

            * </b></font></td>

          </tr>

         

          <tr>

            <td valign="middle" align="right"><font size="2">

            <input type="text" name="Category" size="46" dir="ltr" value="[[Category]]"></font></td>

            <td valign="top" dir="rtl">
         <p align="right"><font face="Arial" size="2" color="#004600">קטגוריה
         </font>

            <font face="Arial" size="2" color="#D58000"><b>

            * </b></font></td>

          </tr>

         

          <tr style="mso-yfti-irow:12">

            <td valign="middle" align="right">&nbsp;</td>

            <td valign="top" dir="rtl">
         &nbsp;</td>

          </tr>

          <tr style="mso-yfti-irow:12">

            <td valign="middle" align="right"><font size="2">

            <input type="text" name="Subject" size="46" dir="rtl" value="[[Subject]]"></font></td>

            <td valign="top" dir="rtl">
         <p align="right"><font face="Arial" size="2" color="#004600">כותרת&nbsp;
         </font>

            <font face="Arial" size="2" color="#D58000"><b>

            * </b></font></td>

          </tr>

          <tr>

            <td valign="middle" align="right"><font size="2">

            <input type="text" name="Price" size="46" dir="rtl" value="[[Price]]"></font></td>

            <td valign="top" dir="rtl">
         <p align="right"><font face="Arial" size="2" color="#004600">מחיר&nbsp;
         </font>

            <font face="Arial" size="2" color="#D58000"><b>

            * </b></font></td>

          </tr>

          <tr>

            <td valign="middle" align="right"><input type="file" name="Pic" size="20" dir="rtl" style="float: right"></td>

            <td valign="top" dir="rtl">
         <p align="right"><font face="Arial" size="2" color="#004600">החלפת תמונה במידת הצורך&nbsp;
         </font>

            <font face="Arial" size="2" color="#D58000"><b>

            * </b></font></td>

          </tr>

          <tr style="mso-yfti-irow:12">

            <td valign="middle" align="right"><img border="0" src="../csv/pics/[[Pic]]" width="70" height="70"></td>

            <td valign="top">&nbsp;[[Pic]]</td>

          </tr>

          <tr>

            <td valign="top" dir="rtl"> 

            &nbsp;<textarea id="textarea2" name="Summary" rows="5" cols="43">[[Summary]]</textarea></td>

            <td valign="top" dir="rtl">

            <font face="Arial" size="2" color="#004600">תקציר
         </font>

            </td>

          </tr>

          <tr style="mso-yfti-irow:12">

            <td valign="top" dir="rtl"> 

            &nbsp;</td>

            <td valign="top" dir="rtl">

            &nbsp;</td>

          </tr>

          <tr style="mso-yfti-irow:12">

            <td valign="top" dir="rtl"> 

            <p align="right"> 
                  

</p>
<textarea name="textarea3" id="Details" rows="10" cols="49"></textarea>

<script>
var info = "[[Details]]";

br_strip = info.replace(/<br\s*\/?>/mg,"\r\n"); //replace <br> tags with \r\n

document.getElementById("Details").value=br_strip;
</script></td>

            <td valign="top" dir="rtl">

            <p align="right" dir="rtl">

            <font face="Arial" size="2" color="#990000">פרטי המודעה</font></td>

          </tr>

          <tr>

            <td valign="middle" align="right"><font size="2">

            <input type="text" name="Header" size="46" dir="rtl" value="[[Header]]"></font></td>

            <td valign="top" dir="rtl">
         <p align="right"><font face="Arial" size="2" color="#004600">כותרת למנועי חיפוש</font><font face="Arial" size="2" color="#D58000"><b>* </b></font></td>

          </tr>

          <tr style="mso-yfti-irow:12">

            <td valign="bottom">

            <p align="center">

           
            <input type="submit" value="thankyou3" name="thankyou" style="float: right">

            <td valign="middle"></td>
</form>

</template>
          </tr>

        </table>

        </div>

        <p>&nbsp;

      </td>

    </tr>

  </table>

  </div>

</td>

    </tr>

    </table>



  </div>



               <p align="right">&nbsp;</td>
            </tr>
            <tr>
               <td>&nbsp;</td>
            </tr>
            <tr>
               <td>&nbsp;</td>
            </tr>
         </table>
      </div>
      </td>
      <td width="16%" valign="top" style="font-family: verdana,arial; font-size: 11px">
      <!--webbot bot="Include" U-Include="../../headers/right.htm" TAG="BODY" -->&nbsp;</td>
   </tr>
</table>





 

 

</body>

</html>

thanks

--------------------------------------------

and this is what i get in the URL address

<textarea name="textarea3" id="Details" rows="10" cols="49"></textarea>

<script>
var info = "";

br_strip = info.replace(/<br\s*\/?>/mg,"\r\n"); //replace <br> tags with \r\n

document.getElementById("Details").value=br_strip;
</script>
« Last Edit: March 02, 2014, 06:41:56 AM by shlomit »

Offline Paul

  • Hero Member
  • *****
  • Posts: 162
Re: Use original form for update
« Reply #27 on: March 02, 2014, 07:21:27 AM »
OK, here is a simple test that works

Code: [Select]

<textarea name="textarea3" id="Details" rows="10" cols="49"></textarea>

<script>
var info = "Hello Shlomit!<br>How are you today?<br>Bye Bye";

br_strip = info.replace(/<br\s*\/?>/mg,"\r\n"); //replace <br> tags with \r\n

document.getElementById("Details").value=br_strip;
</script>

I simply replaced [[Details]] with a message. Now, I'm wondering if your database data for [[Details]] is somehow breaking the script.

Can you give an example of the [[Details]] data?
« Last Edit: March 02, 2014, 07:23:56 AM by Paul »

Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
Re: Use original form for update
« Reply #28 on: March 02, 2014, 07:52:19 AM »
I tried it. when i open the template to update it, the whole text that was there before is gone, but the Hello etc is there..

Offline Jason

  • Administrator
  • Hero Member
  • *****
  • Posts: 1018
    • slipdex
Re: Use original form for update
« Reply #29 on: March 02, 2014, 12:17:09 PM »
Shlomit,

Most likely you have double quotes (") somewhere in your [[Details]] field that is filling into the script. That is what is breaking Paul script and preventing it from displaying anything.

Jason
Founder of www.slipdex.com