Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 981357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:31:50+00:00 2026-05-16T04:31:50+00:00

I’m creating a weekly HTML email writing template (hence the weird file name) and

  • 0

I’m creating a weekly HTML email writing template (hence the weird file name) and I’m using ASP and XML as the backend. The XML is prefect but the ASP isn’t..

What I’m going for here is to create an XMl node that has a value of notchecked and checked depending on if the checkbox on the form is checked or not.

I’ve tried using

If Request.QueryString("promotioncheck") = "on" Then
        Set objField = objDom.createElement("promotioncheck")
        objField.Text = "checked"
        objRecord.appendChild objField
Else
        Set objField = objDom.createElement("promotioncheck")
        objField.Text = "notchecked"
        objRecord.appendChild objField
        End If 

but when I do it doesn’t pick up the changes and just outputs notchecked even when the checkbox is checked.

Here’s my ASP:

<%
If Request.Form("hidden") = "true" Then
    Dim objDom
    Dim objRoot
    Dim objRecord
    Dim objField
    Dim objFieldValue
    Dim objattID
    Dim objattTabOrder
    Dim objPI
    Dim blnFileExists
    Dim x
    Dim z
    Set objDom = server.CreateObject("Microsoft.XMLDOM")
    objDom.preserveWhiteSpace = True



    blnFileExists = objDom.LoadXML(server.mappath("./")& "/eg"&Day(Date)&"_"&Month(Date)&".xml")


    If blnFileExists = True Then

    For x = 1 To Request.Form.Count

    If instr(1,Request.Form.Key(x),"hidden") = 0 Then
        Set z = objDom.selectNodes("eg/stories/"&Request.Form.Key(x))
        Response.Write(Request.Form.Key(x))
        z.innerText = Request.Form(x)
    End If
Next 
Else

    Set objRoot = objDom.createElement("eg")
    objDom.appendChild objRoot
    Set objRecord = objDom.createElement("stories")
    objRoot.appendChild(objRecord)
    For x = 1 To Request.Form.Count


    If instr(1,Request.Form.Key(x),"hidden") = 0 Then
        Set objField = objDom.createElement(Request.Form.Key(x))
        objField.Text = Request.Form(x)
        objRecord.appendChild objField
    End If
    Next
    If Request.QueryString("promotioncheck") = "on" Then
        Set objField = objDom.createElement("promotioncheck")
        objField.Text = "checked"
        objRecord.appendChild objField
    Else
    Set objField = objDom.createElement("promotioncheck")
        objField.Text = "notchecked"
        objRecord.appendChild objField
        End If
End If
If blnFileExists = False then

    Set objPI = objDom.createProcessingInstruction("xml", "version='1.0'")

    objDom.insertBefore objPI, objDom.childNodes(0)
End If


objDom.save (server.mappath("./")& "/eg"&Day(Date)&"_"&Month(Date)&".xml")



Set objDom = Nothing
Set objRoot = Nothing
Set objRecord = Nothing
Set objField = Nothing
Set objFieldValue = Nothing
Set objattID = Nothing
Set objattTabOrder = Nothing
 Set objPI = Nothing

On Error Resume Next
End If
%>

And heres the HTML form that has the checkbox

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
     <title>EG Editor</title>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     <script type="text/javascript">
     var number_of_nibs = 1;

     function addnib(){
     number_of_nibs ++;
     var title = document.createElement('h2');
     title.innerHTML = "Story" + number_of_nibs;
     var nibformtitle = document.createElement('p');
     nibformtitle.innerHTML = "Title:<br><input type=\"text\" name=\"nib"+   number_of_nibs +"_title\" style=\"width: 400px;\">";
     var nibformcontent = document.createElement('p');
      nibformcontent.innerHTML = "Content:<br><textarea cols=\"22\" rows=\"7\" name=\"nib"+ number_of_nibs + "_content\" style=\"width: 400px;\"></textarea>";
     var smallnewsdiv = eval("document.getElementById('smallnews')");
      smallnewsdiv.appendChild(title);
      smallnewsdiv.appendChild(nibformtitle);
      smallnewsdiv.appendChild(nibformcontent);
      }


     </script>
     </head>
     <body>
     <h1>EG Editor</h1>
      <p>Welcome to the EG Editor, your one stop shop for making your EG email</p>
     <p>Please Fill out the form like you would any other internet form, press save when your done</p>
     <p>Once you've saved your content, you can then click on the link to the finished product, save the file as HTML (file->save as->html only option when saving), open in word and then Send to yourself (File->Send To->Mail Recipient) and biggity-bam you've got your issue of EG</p>
    <h2>Main Stories</h2>
    <p>Here is where you put in your stuff for your Main stories</p>
    <form name="form1" action="Egbuilder.asp" method="post">
    <table>
    <tr>
    <td>Story One:</td>
    <td>Title: <input type="text" name="mainstory1_title" style="width: 220px"></td>
    <td>Content: <textarea cols="22" rows="7" name="mainstory1" style="width: 220px;"> </textarea></td>
    </tr>
    <tr>
    <td>Story Two:</td>
    <td>Title: <input type="text" name="mainstory2_title" style="width: 220px"></td>
    <td>Content: <textarea cols="22" rows="7" name="mainstory2" style="width: 220px;"></textarea></td>
    </tr>
    <tr>
    <td>Story Three:</td>
    <td>Title: <input type="text" name="mainstory3_title" style="width: 220px"></td>
    <td>Content: <textarea cols="22" rows="7" name="mainstory3" style="width: 220px;"></textarea></td>
    </tr>
    <tr>
    <td>Story Four:</td>
    <td>Title: <input type="text" name="mainstory4_title" style="width: 220px"></td>
     <td>Content: <textarea cols="22" rows="7" name="mainstory4" style="width: 220px;"></textarea></td>
    </tr>
    </table>
    <h2>Promotions</h2>
    <p>If there's a promotion this week then tick the 'show promotion' box, Just pop your words into the box and then copy the Intranet link into the link box.</p>
   <p>Show Promotion? <input type="checkbox" name="promotioncheck" ></p>
   <p>Banner Text:<br>
   <textarea cols="22" rows="7" name="promotiontext" style="width: 400px;"></textarea></p>
   <p>Intranet Link: <br>
  <input type="text" name="promotionlink" style="width: 400px"></p>
  <div id="smallnews">
  <h2>News in Briefs</h2>
  <p>Here is where you add your smaller stories, you can add as many as you want. Just click the green plus button to add another box</p>
  <h3>Story 1</h3>
  <p>Title:<br>
  <input type="text" name="nib1_title" style="width: 400px"></p>
  <p>Content:<br>
 <textarea cols="22" rows="7" name="nib1_content" style="width: 400px;"></textarea>
  </p>
 </div>
 <p><a href="Javascript:addnib()" title="Press this button to add another button"><img src="images/add.jpg" alt="add button" style="width: 30px; height: 30px; border: 0px">Add another Story</a><input type="hidden" name="hidden" value="true"><input style="margin-left: 200px;" type="submit" value="Save" ></p>
</form>
</body>
 </html>

I’m sure it’s really simple and I’ve just missed something basic but any help would be appreciated. thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:31:51+00:00Added an answer on May 16, 2026 at 4:31 am

    You’re currently retrieving promotioncheck from the Querystring, but you’re POSTing the form so the value won’t be in the QueryString collection.

    Instead retrieve the value from the Form collection like so:

    Request.Form("promotioncheck") = "on"
    

    I can’t remember what the default return value for a checkbox with no value attribute set is in classic asp, so double check “on” is being returned.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.