Bit of a long winded question - I'm basically using the toggle function from Bootstrap to show and hide a text box when clicking a button. My issue is, the text box and button is used for each item in a list which is dynamically loaded so I can't assign IDs via HTML as usual.

How can I generate a different ID for each text box and add that ID to each text box's button's href tag?

Here's my code of the text box and button (which sits inside an li tag along with some other information which gets generated for each item in the list):

<div id="comment-container">
    <a data-toggle="collapse" href="" aria-expanded="false" aria-controls="add-comment" class="btn btn-primary add-comment"><i class="fa fa-plus-circle"></i><span>Add Comment</span></a>
    @Html.TextAreaFor(x => Model.CurrentStage.Responses[i].Comment, new { @class = "form-control comment collapse", rows = 3, placeholder = "Enter a comment to accompany your response here:" })
</div>

I've played about with some snippets of jquery, but nothing's quite worked so far.

Here's how it should look when it works: Screenshot

I am having this frustrating problem. I change text in a razor view (cshtml), Start without Debugging, refresh (Ctrl+F5) the browser but nothing happens. The strange part is that if I modify a controller's return value (say return Ok("test");) or an included static file (like CSS), refresh, the change is visible. The razor view only updates if I stop start and stop debugging every time.

Here are things I have already tried:

  • Made sure that Detect when file is changed outside the environment is checked.
  • On run, when projects are out of date is Always build.
  • Tried this on Edge, Chrome and Firefox with and without hard refreshing.
  • Restarting Visual Studio numeral times.
  • Cleaning/rebuilding solution.
  • Doing this on new template projects.

P.S. I see there are many similar questions, none of the answers, however, seem to fix my problem.

Update

This appears to be a problem on a much larger scale. If I:

  1. Create a required razor section in the parent view like this @RenderSection("css", required: true).
  2. Not implement the rendering in the child view.
  3. I (obviously) get the InvalidOperationException: The following sections have been defined but have not been rendered by the page at 'bla\bla\bla':css.
  4. Then I implement it.
  5. Save, Ctrl+F5 in Firefox. The error persists.

At this point, VS 2015 is practically unusable because you don't know, if you're actually missing something or it's VS acting out

Trying to add a chart inline to a view.

Folder structure:

"parent" view is in "views/account/AccountHome.cshtml"<br />
"chart" partial view is in "views/shared/ChartsPartial.cshtml"

If I add this code into the parent view

@Html.Partial("ChartsPartial")

the chart displays correctly as a (whole screen) image overlaying the view. So I know the code within ChartsPartial.cshtml works fine

But I want to display the charts within the AccountHome.cshtml view. So looking it up on Google (and following a number of questions on here), the suggestions were to add:

<img src="~/Views/Shared/ChartsPartial.cshtml" />

I use Visual Studio 2015 and this is the url it picked out using intellisense. But I've tried a number of combinations including the FULL url but to no avail.

All I get is a "image not found" icon instead of the chart. Where am I going wrong?

For completeness, ChartsPartial.cshtml contains the following:

@model FiveADayMVC2.Models.fad_userFoods
@{
var myChart = new Chart(width: 600, height: 400)
.AddTitle("Chart Title")
.AddSeries(
name: "Employee",
xValue: new[] { "Peter", "Andrew", "Julie", "Mary", "Dave" },
yValues: new[] { "2", "6", "4", "5", "3" })
.Write();
}

Using c#, visual studio, razor html and asp.net, i have an orders table which saves a customer number to it in th ecustoemr_id, and it then autoincrements the order_id field, i need to select the order id of the row ive just inserted. i cannot just select all from that customer number, because there will be multiple order id's to customers. below is how i'm saving the customer id to the database, i need the order id from the row just created printed into a variable. i've spent hours googling, and found answers for PHP but nothing using c# and asp.net thanks in advance

string sql = "insert into orders (User_ID) values ('" + Request["UserID"] + "')";
var rst1 = db.Query(sql);

I am looking to override the common EditorFor HtmlHelper to read MetaData from the a partial class on top of the model. I pretty much want to be able to add custom attributes to my metaData class to be used when creating by forms. For example.

 public class Metadata
 {
 [NonEditable]
 public string ContentId;
 ...

And in a seperate class to create a valid attribute

public class NonEditable : Attribute
{
}

Would create a read-only textbox whenever that property was called. I have used the following example to change the base type for my Razor View and am inheriting from HtmlHelper...

 public abstract class MyWebViewPage<TModel> : WebViewPage<TModel>
{
    public new MyHtmlHelper<TModel> Html { get; set; }

    public override void InitHelpers()
    {
        base.InitHelpers();
        Html = new MyHtmlHelper<TModel>(ViewContext, this);
    }
}

And here is the MyHtmlHelper Declaration

public class MyHtmlHelper<TModel> : HtmlHelper<TModel>
{
    public MyHtmlHelper(ViewContext viewContext, IViewDataContainer viewDataContainer) : this(viewContext, viewDataContainer, RouteTable.Routes)
    {
    }

    public MyHtmlHelper(ViewContext viewContext, IViewDataContainer viewDataContainer, RouteCollection routeCollection) : base(viewContext, viewDataContainer, routeCollection)
    {
        ViewContext = viewContext;
        ViewData = new ViewDataDictionary<TModel>(viewDataContainer.ViewData);
    }

    public new ViewDataDictionary<TModel> ViewData
    {
        get;
        private set;
    }

    public new ViewContext ViewContext
    {
        get;
        private set;
    }
}

And then having set the Web.Config in the Views Folder to point to the inherited base class.

<pages pageBaseType="MyWebViewPage">

I then extend the EditorFor Helper, and this is where I run into trouble! The metaData search does not pick up my NonEditable Attribute and passing in additionalViewData causes the HTML to be rendered incorrectly.

    public static class MyEditorExtensions
    {
    public static MvcHtmlString EditorFor<TModel, TValue>(this MyHtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, object additionalViewData)
    {
        var metaData = ModelMetadata.FromLambdaExpression(expression, html.ViewData);
        bool isReadOnly = metaData.ContainerType.GetProperty(metaData.PropertyName)
                                  .GetCustomAttributes(typeof(NonEditable), false)
                                  .Any();

            if (isReadOnly)
            // Add to the additionalViewData and display this correctly...
            return html.TextBoxFor(expression, additionalViewData);
        else
            return html.TextBoxFor(expression, additionalViewData);
        }
    }

Here is the Edit.cshtml...

<div class="form-group">
        @Html.LabelFor(model => model.ContentId, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.ContentId, new { htmlAttributes = new { @class = "form-control" } })
            @Html.ValidationMessageFor(model => model.ContentId, "", new { @class = "text-danger" })
        </div>
    </div>

and output...

<input type="text" value="225535" name="ContentId" id="ContentId" htmlattributes="{ class = form-control }" data-val-number="The field ContentId must be a number." data-val="true">

Can anyone help with this? I would have thought having types in metaData altering form properties to have been fairly common yet I cannot find a good way around it.

I have an ASP.NET MVC5 app using Razor.

One of the view displays a form. I would like one of this form's button to call the controller via ajax and pass him the current ViewModel without submitting the form.

Not sure if I am clear. I know how to get the ViewModel back from the View to the Controller when submitting the form. But in this case, I don t want to submit the form, but I need to pass the ViewModel.

Is this possible?

I suppose I could pass to Ajax the form serialization via Jquery this way:

$("Formid").serialize()

But maybe Razor is able to pass the ViewModel directly?

Thx in advance

In Umbraco you can create doc types that you can also duplicate as a template.

You can then assign Partial views to your template based on your defined doc types.

Does anyone know how you could stack child pages into the master page template?

so if you had 1 master page, you could create child pages and order them as necessary in the master template by using the sorting functionality?

model.Question2AResponse and model.Question2AResponse are two fields that are of type decimal. I want it to be so the user can enter commas into the Html.EditorFor boxes and have them display, but the model not actually take the value of the comma. So display the comma the user types in, but not actually save the value to the model. Is that possible?

@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
    <fieldset>
        <legend>Questions</legend>
        <div id="content">
            @Html.DisplayFor(model => model.Question2A.QuestionText)
            <br />
            @Html.EditorFor(model => model.Question2AResponse)
            <br />
            @Html.DisplayFor(model => model.Question2B.QuestionText)
            <br />
            @Html.EditorFor(model => model.Question2BResponse)
        </div>
        <div id="buttons">
            <br />
            <input type="submit" name="Command" value="Previous" />
            <input type="submit" name="Command" value="Next" />
        </div>

    </fieldset>
}

i am new to c#, razor and MVC.

I making a web app (first project) in razor MVC, Ill explain what im trying to achieve. On one of my views i need a textarea / box with a submit button beside it that sends/posts the text from that box to a textarea / box on a different view within the project.

Im keen to learn this using the Razor, MVC way, rather than Java Script etc

Hope someone can provide some help to get me started, Thanks

I can't figure out how to make my x-axis labels rotate to an angle. This is in .cshtml view, using razor syntax. You see my attempt, below is on the line that says LabelStyle Angle=""0"". Anyone know?

.CSHTML View

@{
    Layout = null;

    string theme = string.Format(@"<Chart>
                        <ChartAreas>
                            <ChartArea Name=""Default"" _Template_=""All"">
                                <AxisX Interval=""1"" LabelAutoFitMinFontSize=""{0}"">
                                    <LabelStyle Angle=""0"" />
                                </AxisX>
                                <AxisY LabelAutoFitMinFontSize=""{0}"" Title=""Hours Needed"" TitleFont=""{0},{0}pt"" IsLogarithmic=""true"" />                                
                            </ChartArea>
                        </ChartAreas>
                        <Legends>
                            <Legend _Template_=""All"" Alignment=""Center"" BackColor=""Transparent"" Docking=""Bottom"" Font=""Trebuchet MS, 8.25pt, style=Bold"" IsTextAutoFit =""False"" LegendStyle=""Row"">
                            </Legend>
                        </Legends>
                        <BorderSkin SkinStyle=""Emboss"" />
                        <Titles>
                            <Title _Template_=""All"" Font=""{1}, {1}pt, style=Bold, GdiCharSet=0"" />
                        </Titles>
                    </Chart>", Model.FontSize, Model.FontSize*2);


    var demandChart = new Chart(Model.Width, Model.Height, theme)
        .AddTitle("Short On Staff")
        .AddSeries(
            "Default",
            chartType: "Column",
            xValue: Model.Customers,
            yValues: Model.Hours
            )                      
        .Write();
}

I am getting Only primitive types or enumeration types are supported in this context while using all IEnumerable objects... I have no idea what is wrong here. Here's my models:

public class UserRoleViewModel
{
    public string Name { get; set; }
    public bool IsChecked { get; set; }

}
public class UserRoleEditViewModel
{

    [DisplayName("Id")]
    public int Id { get; set; }

    [DisplayName("User Name")]
    public string UserName { get; set; }

    [DisplayName("User Roles")]
    public IEnumerable<UserRoleViewModel> UserRoles { get; set; }

}

Here's the Controller:

 public ActionResult Edit(int? id)
    {
        if (id == null)
        {
            return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        }
        User user = db.Users.Find(id);
        if (user == null)
        {
            return HttpNotFound();
        }

        UserRoleEditViewModel model = new UserRoleEditViewModel
        {                
            UserName = user.UserName,
            Id = user.Id,
            UserRoles = db.UserRoles.Select(x=> new UserRoleViewModel(){Name = x.RoleName, IsChecked = x.Users.Contains(user)}).AsEnumerable()                
        };

        return View(model);
    }

And the View:

            @foreach (var userRoleViewModel in Model.UserRoles)//<ERR
            {
                <div>
                    @Html.Hidden(userRoleViewModel.Name)
                    @Html.CheckBox(userRoleViewModel.IsChecked.ToString())
                    @Html.Label(userRoleViewModel.Name, userRoleViewModel.Name)
                </div>
            }
        </div>

tried this too:

 @for (int i = 0; i < Model.UserRoles.Count(); i++) //<ERR
            {                    
                <div>
                    @Html.Hidden(Model.UserRoles.ToList()[i].Name)
                    @Html.CheckBox(Model.UserRoles.ToList()[i].IsChecked.ToString())
                    @Html.LabelFor(x => x.UserRoles.ToList()[i].IsChecked, Model.UserRoles.ToList()[i].Name)
                </div>
            }

My viewmodels are all IEnumerable'd... so, I have no idea what is wrong here.

Lines above marked "//

nor

@foreach (var userRoleViewModel in Model.UserRoles)

I'm pretty new in ASP.NET Razor, and i'm trying to establish a very simple thing, so far unsuccessfully.

I have a button, and input field in the HTML. What i want is to call a C# function with the input field's text, when i click on the button.

I can call the function, but i cannot pass the parameter. How could i refer to the text in this input field?

I have searched on the internet, but i haven't found a simple solution. Are there any? I though something like this one:

<input id="Text1" name="Text1" type="text" />
<input id="Button1" type="button" value="button" onclick="@{Class1.Myfunction(Text1.InnerText);}" />

Thank you!

I am trying to grab values from my Cshtml to my HelperClass and then play with that data in my HomeController. I am trying to get my radio buttons data(value) and want to do summonerName as well but its the same concept. So if I could get help with one I could do the other. Now my interface can change to different methods etc. I am using Dependency Injection so I believe everything essentially runs through the interface. I am kinda lost so I could really use the help, thanks!

INTERFACE

   public interface IHomeHelper
{
    string getSummonerName(string summonerName);
    void getRegion(string region);
    string setSummonerName(string summonerName);
    void setRegion(string region);

}

HELPER CLASS

    public class HomeHelper : IHomeHelper
{
    public void getRegion(string region)
    {
        throw new NotImplementedException();
    }

    public string getSummonerName(string summonerName)
    {
        throw new NotImplementedException();
    }

    public void setRegion(string region)
    {
        throw new NotImplementedException();
    }

    public string setSummonerName(string summonerName)
    {
        throw new NotImplementedException();
    }
}

MODEL

public class HomeModel
{
    [Required]
    public string region { get; set; }
    [Required]
    [StringLength (255, MinimumLength = 5)]
    public string summonerName { get; set; }

}

CONTROLLER

    public class HomeController : Controller
{
    private readonly IHomeHelper _homeHelper;


    public HomeController(IHomeHelper homeHelper)
    {
        _homeHelper = homeHelper;

        if (ViewBag.region != null)
        {
            Console.WriteLine(ViewBag.region);
        }
    }

    public IActionResult Index()
    {


        return View();
    }

Index.cshtml FORM

  <form role="form" method="post">
   <div asp-validation-summary="ValidationSummary.ModelOnly"></div>
   <div class="col-md-12 form-group">
    <input type="search" size="100" id="mySearch" placeholder="Search for Summoner Name" asp-for="summonerName">
    <span asp-validation-for="summonerName"></span>
    <button type="submit" class="btn btn-primary "  formmethod="post">Search</button>
 </div>
 <div class="row">
  <div class="col-md-12 form-group">
  <label> NA</label>
 <input type="radio"  name ="region" id="NA" value="NA" asp-for="region" asp-items="ViewBag.region" />
  <span asp-validation-for="region"></span>
   <label>EUW</label>
  <input type="radio" name="region" id="EUW" value="EUW" asp-for="region" asp-items="ViewBag.region">
    <span asp-validation-for="region"></span>
                            </div>
                        </div>
                    </form>

I'm pretty new in ASP.NET Razor, and i'm trying to establish a very simple thing, so far unsuccessfully.

I have a button, and input field in the HTML. What i want is to call a C# function with the input field's text, when i click on the button.

I can call the function, but i cannot pass the parameter. How could i refer to the text in this input field?

I have searched on the internet, but i haven't found a simple solution. Are there any? I though something like this one:

<input id="Text1" name="Text1" type="text" />
<input id="Button1" type="button" value="button" onclick="@{Class1.Myfunction(Text1.InnerText);}" />

Thank you!

So far everything loads without error, and the SQL calls will be replaced with more secure stored procedures once everything is working. When I select a furnace from the drop down down menu, it should pass to the method and fill the textbox with the run number. But when I select anything, it only goes back to the first index 10A. I have also coded that index 0 should say "Select Furnace" but that is also not showing, only the first index. Is there any suggestions on how to grab a selected Index and populate a textbox from a SQL query?

 <asp:Content ID="BodyContent" ContentPlaceHolderID="BodyPlaceHolder" runat="server">
  <center>
   <table style="text-align:left">
    <tr>
     <td align="right">
            <asp:Label ID="FurnaceID" Text="JUMP TO FURNACE : " runat="server" />
        </td>
        <td></td>
        <td>
    <asp:DropDownList ID="FurnID" runat="server" AutoPostBack ="true"
        onselectedindexchanged="FurnID_SelectedIndexChanged" Width="150px">
        <asp:ListItem Text="Select Furnace" Value = "0" />
    </asp:DropDownList>

Behind The Code:

LoadList(); is called in the page_load event

   public void LoadList()
    {

            SqlCommand cmd = new SqlCommand("SELECT * FROM [Furnace]", new SqlConnection(ConfigurationManager.ConnectionStrings["FurnaceDeckConnectionString"].ConnectionString));
            cmd.Connection.Open();

            SqlDataReader Furns;
            Furns = cmd.ExecuteReader();


            FurnID.DataSource = Furns;

            FurnID.DataValueField = "Furnaceno";
            FurnID.DataTextField = "Furnaceno";
            FurnID.DataBind();

            cmd.Connection.Close();
            cmd.Connection.Dispose();

    }

When the index is changed this method is called:

protected void FurnID_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            String selectedFurn = "";
            ListItem selectFurn = FurnID.Items.FindByText(selectedFurn);
            LoadFurnDetails(selectedFurn);
        }

    }

    public void LoadFurnDetails(String F)
    {
        String selectF = F;
        DataTable dt = new DataTable();
        SqlCommand cmd = new SqlCommand("SELECT * FROM [Furnace Run Data Table] Where Furnace = 'selectF' and Completed = 0 ", new SqlConnection(ConfigurationManager.ConnectionStrings["FurnaceDeckConnectionString"].ConnectionString));
        cmd.Connection.Open();
        SqlDataAdapter sqlDa = new SqlDataAdapter(cmd);
        sqlDa.Fill(dt);

        if (dt.Rows.Count > 0)
        {
            lblFurnId.Text = dt.Rows[0]["runno"].ToString();


        }

        cmd.Connection.Close();
        cmd.Connection.Dispose(); 

    }

I am validation for Html.TextBoxFor. Here is my code on the view

@Html.TextBoxFor(m => m.Amount, new {@class = "form-control", Value = String.Format("{0:C}", Model.Amount) })

This code takes the double value from the database like 5000.00 and displays on the UI as $5,000.00. However when the user hits the submit button, a validation error is displayed that

The value '$5,000.00' is not valid for Amount.

My validation annotation on the Model is

[Range(0, double.MaxValue, ErrorMessage = "Please enter valid dollar amount")]

To get it to submit, I had to retype as 5000.00. How can I fix this? Thanks.

Scenario: I've added a client side url validator using the following regex pattern. The pattern is supposed to check whether the URL input matches.

^(?#Protocol)(?:(?:ht|f)tp(?:s?)\:\/\/|~\/|\/)?(?#Username:Password)(?:\w+:\w+@)?(?#Subdomains)(?:(?:[-\w]+\.)+(?#TopLevel Domains)(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))(?#Port)(?::[\d]{1,5})?(?#Directories)(?:(?:(?:\/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/)+|\?|#)?(?#Query)(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?#Anchor)(?:#(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)?$

Issue:

When I debug the ValidateOtherInstituteWebsite JavaScript method via IE, a JavaScript runtime error - unexpected quantifier error is thrown.

Checks:

I implemented the same regex in my C# server side validation method with no error, and the regex matches appropriately. From researching the error it seems the compiler is interpreting some of the regex as code, but I don't see where.

Question:

How can this regex pattern be edited to work with JavaScript?

Code:

function ValidateOtherInstituteWebsite(sender, args) {

    var valid = false;

    alert("debug alert");
    var otherInstituteWebsiteText = $("#vs_institutewebsite").text();
    var otherInstituteWebsiteUrl = otherInstituteWebsiteText;

    var urlValidationRegex = new RegExp("^(?#Protocol)(?:(?:ht|f)tp(?:s?)\:\/\/|~\/|\/)?(?#Username:Password)(?:\w+:\w+@)?(?#Subdomains)(?:(?:[-\w]+\.)+(?#TopLevel Domains)(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))(?#Port)(?::[\d]{1,5})?(?#Directories)(?:(?:(?:\/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/)+|\?|#)?(?#Query)(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?#Anchor)(?:#(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)?$");

    if (urlValidationRegex.test(otherInstituteWebsiteUrl))
    {
        valid = true;
    }

    args.IsValid = valid;

}

Exception screen shot:

enter image description here

I have an ASPX page that features a Telerik RadGrid that contains 8 columns. The first 7 load really quickly, but my 8th column involves a time-intensive calculation that was making my page hang for a while before loading.

When I removed the 8th column and loaded the grid with just the first 7, it loaded in a reasonable amount of time. My solution to this problem was to start two threads in my code-behind with C#. The first thread would load the grid using a data source that included the first 7 columns as normal and inserted null values for the 8th column. The second thread would load a second data source that included the true value of the 8th column. I would then like to assign the second data source to the RadGrid and repaint the grid on the page.

My RadGrid looks like this on the ASPX page:

<telerik:RadGrid ID="myGridID" runat="server" GridLines="None" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"  AutoDataBind="False" OnItemDataBound="Function1" OnItemCommand="Function2" OnDetailTableDataBind="Function3" OnNeedDataSource="Function4" Width="700px"> <MasterTableView DataKeyNames="data_id" HierarchyDefaultExpanded="true" ShowHeader="false" Name="myName">
<DetailTables>
<telerik:GridTableView DataKeyNames="id" Name="myName" Width="100%">
<Columns>
<telerik:GridBoundColumn UniqueName="columnName1" HeaderText="The column" DataField="column1">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="columnName2" HeaderText="The Other Column" DataField="column2">
...

I called the second thread on "Page PreRender":

 protected void Page_PreRender(object source, EventArgs e){
      GridDataKeyArray myDataArray= myGridID.MasterTableView.DataKeyValues;
      Thread thread = new Thread(x => GetData(myDataArray, e));
      thread.Start();
 }

 private void GetData(GridDataKeyArray myDataArray, System.EventArgs e){
        //Here is where I insert code that uses myDataArray to populate the 
        //'data' variable

        myGridID.DataSource =  data;
        //I've tried Rebind() and DataBind() here
        myGridID.Rebind();

When I step through my code with breakpoints, it appears to work and rebind the data. However, I can't figure out how to send the data back to the ASPX page, so that I can repaint the grid with a partial page refresh. I'm starting to think that this can't be done the way that I'm attempting to do it, but I wanted to check here first to see if I'm missing something.

I need to install an asp.net web api service on an onpremises IIS where there is an active directory.

I found this link: http://www.asp.net/web-api/overview/security/integrated-windows-authentication

but its not clear how to authorize this service to be used only for one specific user.

I have a checkbox list for the products to selected, with another text entry for quantity. Upon clicking Submit, I need two actions to be performed: 1) I would like to get the customers selection and entry into an email (with a given email address) and emailed as a (create) PDF attachment with date-time stamp. 2) The next page after hitting submit button, should produce next/another page with email confirmation message and a print button of the PDF attachment with date-time stamp. There are many other things that go into this webform, but this is the area that I am needing some guidance and any link or code example to help me find a proper solution you can reply me here would be much appreciated.

Upon thorough research I was able to allow one data value to be edited and updated within my table. However, when I attempt to alter where the contenteditable can be edited, It removes my formatting of the table (it actually removes the table format completely, rendering my idea pointless.

Here is my current code.

              <div class="bs-docs-example">
            <table class="table table-striped">
              <thead>
                <tr>
                  <th>#</th>
                  <th>IRC Name</th>
                  <th>Ingame Name</th>
                  <th>Position</th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td>1</td>
                  <td>[Cr|m|nAl]</td>
                  <td id="content2" contenteditable="true">Herbalist</td>
                  <td>Aeterna Top</td>
                </tr>
                <tr>
                  <td >2</td>
                  <td >bandido</td>
                  <td >Bananni</td>
                  <td >Aeterna Top</td>
                </tr>
                <tr>
                  <td>3</td>
                  <td>Funkystyle</td>
                  <td>Funkystyle</td>
                  <td>Aeterna Top</td>
                </tr>
              </tbody>
            </table>
          </div>
    </div>
</div>
    <button id="save">Save Changes</button>

<!-- begin the script -->
<script src="js/jquery.js" type="text/javascript"></script>
<script>
    var theContent = $('#content2');// set the content

    $('#save').on('click', function () { // store the new content in localStorage when the button is clicked
        var editedContent = theContent.html();
        localStorage.newContent = editedContent;
    });

    if (localStorage.getItem('newContent')) { // apply the newContent when it is exist ini localStorage
        theContent.html(localStorage.getItem('newContent'));
    }
</script>

Now, ideally I would like it to output like this screenshot below; http://i.imgur.com/R4TYhRB.png With the column of "Ingame Name" editable. Add Row/Remove Row, I'm wanting to implement too, but I'm not too sure if you can do it with such a simple HTML table.

My First question- how would I make a particular row (i.e Ingame Name) be the only one editable? I'm terrible have Javascript/Jquery and my research unfortunately, only allows me to refine one row. (I know I could probably replicate the javascript/jquery, but surely there is an easier way?)

Second question-

Is it possible to actually add the ability for a HTML table to add/remove rows without having a database of some sort?

Thanks for any guidance in regards to this.