Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag for United States of America

asked on

Script to copy value from drop down menu to online HTML editor

I have a page that has a drop down menu with a tag name and the value that it adds, example.

Drop down menu name:  First Name
Drop down value: [Alien: First]

when user selects it it should copy the value over to the editor where the cursor is on at the moment. This way they can create draft letters that populate automatically with database data.

The problem is that the script I currently have stopped working when the editor was upgraded. It works fine on the previous version of the editor but not the latest. I am using DMX HTML Editor 3.

http://www.dmxzone.com/go/18424/advanced-html-editor-3/

This is the editor's code:

  <textarea id="editor1" name="editor1" class="dmxEditor" style="width:800px;height:500px"><%=(LetterMrg.Fields.Item("LtrBody").Value)%></textarea>
<script type="text/javascript">
  // <![CDATA[
 jQuery(document).ready(
   function()
     {
       jQuery("#editor1").dmxEditor(
         {"width": 800, "height": 500, "toolbars": {"History": {"enabled": false}, "Search": {"enabled": false}, "Style": {"enabled": false}}}
       );
     }
 );
  // ]]>
</script>

This is my drop down menu code:

 <select name="s" size="1" class="bodytext" onChange="dmxedit_insertHTML('editor1',document.form1.s.options[document.form1.s.selectedIndex].value)">
                    <option value=" "></option>
                    <option value="[Alien:Title] [Alien:First] [Alien:Last]<br>[Alien:ResStr]<br>[Alien:ResCity], [Alien:ResState] [Alien:ResZip]">Contact - Block</option>
                    <option value="[Alien:Last]">Contact - Last Name</option>
                    <option value="[Alien:First]">Contact - First Name</option>
                    <option value="[Alien:MidName]">Contact - Middle Name</option>
                    <option value="[Alien:Title]">Contact - Title</option>
                    <option value="[Alien:MaidenNm]">Contact - Maiden Name</option>
                    <option value="[Alien:MailCareof]">Contact - Mail Address Care Of</option>
                    <option value="[Alien:MailStr]">Contact - Mail Address Street</option>
                    <option value="[Alien:MailApt]">Contact - Mail Address Apt.</option>
                    <option value="[Alien:MailCity]">Contact - Mail Address City</option>
                    <option value="[Alien:MailState]">Contact - Mail Address State</option>
                    <option value="[Alien:MailZip]">Contact - Mail Address Zip Code</option>
                    <option value="[Alien:MailCntry]">Contact - Mail Address Country</option>
                    <option value="[Alien:ResCareOf]">Contact - Residence Address Care Of</option>
                    <option value="[Alien:ResStr]">Contact - Residence Address Street</option>
                    <option value="[Alien:ResApt]">Contact - Residence Address Apt.</option>
                    <option value="[Alien:ResCity]">Contact - Residence Address City</option>
                    <option value="[Alien:ResState]">Contact - Residence Address State</option>
                    <option value="[Alien:ResZip]">Contact - Residence Address Zip Code</option>
                    <option value="[Alien:ResCntry]">Contact - Residence Address Country</option>
                    <option value="[Alien:AbrdCareOf]">Contact - Abroad Address Care Of</option>
                    <option value="[Alien:AbrdStr]">Contact - Abroad Address Street</option>
                    <option value="[Alien:AbrdApt]">Contact - Abroad Address Apt.</option>
                    <option value="[Alien:AbrdCity]">Contact - Abroad Address City</option>
                    <option value="[Alien:AbrdState]">Contact - Abroad Address State</option>
                    <option value="[Alien:AbrdZip]">Contact - Abroad Address Zip Code</option>
                    <option value="[Alien:AbrdCntry]">Contact - Abroad Address Country</option>
                    <option value="[Alien:Dob]">Contact - Date of birth</option>
                    <option value="[Alien:Country]">Contact - Country of birth</option>
                    <option value="[Alien:PPNum]">Contact - Passport Number</option>
                    <option value="[Alien:PPCountry]">Contact - Passport Country</option>
                    <option value="[Alien:PPExpiration]">Contact - Passport exp. Date</option>
                    <option value="[Alien:Nationality]">Contact - Nationality</option>
                    <option value="[Alien:AlienNum]">Contact - Alien Number</option>
                    <option value="[Alien:SSN]">Contact - SSN</option>
                    <option value="[Alien:Dayphone]">Contact - Dayphone</option>
                    <option value="[Alien:EvePhone]">Contact - Evening Phone</option>
                    <option value="[Alien:Fax]">Contact - Fax</option>
                    <option value="[Alien:Email]">Contact - Email</option>
                    <option value="[Alien:Arrivaldate]">Contact - Arrival date</option>
                    <option value="[Alien:Arrivalcity]">Contact - Arrival city</option>
                    <option value="[Alien:Arrivalstate]">Contact - Arrival state</option>
                    <option value="[Alien:I94]">Contact - I94 number</option>
                    <option value="[Alien:NiStatus]">Contact - Current status</option>
                    <option value="[Alien:ExpiresOn]">Contact - Status exp. Date</option>
                    <option value="[Case:CaseId]">Case - Number</option>
                    <option value="[Case:CaseName]">Case - Name</option>
                    <option value="[LawFirm:Name]">Law Firm - Name</option>
                    <option value="[Employer:AttnTo]<br>[Employer:EmpName]<br> [Employer:Street], [Employer:Suite]<br>[Employer:City], [Employer:State] [Employer:Zip]">Employer - Block</option>
                    <option value="[Employer:EmpName]">Employer - Name</option>
                    <option value="[Employer:Street]">Employer - Street</option>
                    <option value="[Employer:Suite]">Employer - Suite</option>
                    <option value="[Employer:City]">Employer - City</option>
                    <option value="[Employer:State]">Employer - State</option>
                    <option value="[Employer:Zip]">Employer - Zip code</option>
                    <option value="[Employer:Country]">Employer - Country</option>
                    <option value="[Employer:AttnTo]">Employer - Attn to</option>
                    <option value="[Employer:Phone]">Employer - Phone</option>
                    <option value="[Employer:Fax]">Employer - Fax</option>
                    <option value="[Employer:email]">Employer - Email</option>
                    <option value="[Employer:SignLastNm]">Employer - Last Name of person authorized to sign</option>
                    <option value="[Employer:SignFirstNm]">Employer - First Name of person authorized to sign</option>
                    <option value="[Employer:SignTitle]">Employer - Tile Last of person authorized to sign</option>
                    <option value="[Employer:IRS]">Employer - IRS Tax #</option>
                    <option value="[Employer:SSN]">Employer - SSN</option>
                    <option value="[Employer:BusinessType]">Employer - Business Type</option>
                    <option value="[Employer:I94]">Employer - Year established</option>
                    <option value="[Employer:Employees]">Employer - Number of Employees</option>
                    <option value="[Employer:GrossIncome]">Employer - Gross Income</option>
                    <option value="[Employer:NetIncome]">Employer - Net Income</option>
                  </select>


I am open to use different code to copy over the values.
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Do you get any errors in the console window?
Avatar of Aleks

ASKER

No. it just does not copy anything to the editor.
This is a purchased product - have you contacted their support center?
Avatar of Aleks

ASKER

I sent an email but it will take time. Is there another script I can try to copy the values over ?
I had a brief look at their site - but can't find an eval version of the plugin to look at so unable to look at the code.

There are these two support forum posts that are relevant

http://www.dmxzone.com/support/18424/topic/52357

And this one

http://www.dmxzone.com/support/18424/topic/53895 (Which I assume is yours)

Both say reported 3 years ago - which seems incorrect given your post here. If the dates are wrong and judging by the comments in the first post it does not look like support for the plugin is that great.

My advice is, if you have paid for this product, put pressure on support for an answer to your query. If they do not respond adequately then consider using something else like the CKEditor
Avatar of Aleks

ASKER

I have paid for it and they never answer the chat or email. Support is in fact not that great. unfortunately.
I was using Webassist but now they only support PHP and they don't have a nice HTML editor.

Is there another HTML editor for dreamweaver that you would recommend ?

Aleks
I am not familiar with the Dreamweaver environment but as far as I know it supports PHP integration?

CKEditor is a good option to look at - I have not tried to use it for the purpose that you want to but take a look and see if it does what you want

http://docs.ckeditor.com/#!/guide/dev_basics
Avatar of Aleks

ASKER

I will give it a shot. I am just tired of trying to get support from DMXZone and fine absolutely none.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aleks

ASKER

I found a GREAT HTML editor which actually has that feature embedded.

http://asp.richtexteditor.com

Highly recommend it .. doing the switch as we speak. Thanks for the help.

A
You are welcome.