Search Results

Search found 3 results on 1 pages for 'thecreator'.

Page 1/1 | 1 

  • JQuery and PHP display problem

    - by TheCREATOR
    I'm new to JQuery but for some reason I cant get the php code to display correctly when I put it in my JQuery script. The php code will display correctly when its not in the JQuery code can someone help me fix my JQuery code so it will display my PHP code correctly? Here is the JQuery and PHP code. var count = 0; $(function(){ $('p#add_field').click(function(){ count += 1; $('#container').append( '<input type="text" name="sk" id="sk" />' + '<label for="exp">Exp: </label>' + '<?php' + 'echo \'<select id="exp" name="exp">\' . "\n";' + 'foreach($options as $option) {' + 'if ($option == $exp) {' + 'echo \'<option value="\' . stripslashes(htmlentities(strip_tags($option))) . \'" selected="selected">\' .' + ' stripslashes(htmlentities(strip_tags($option))) . \'</option>\' . "\n";' + '} else {' + 'echo \'<option value="\'. stripslashes(htmlentities(strip_tags($option))) . \'">\' .' + 'stripslashes(htmlentities(strip_tags($option))) . \'</option>\'."\n";' + '}' + '}' + 'echo \'</select>\';' + '?>' + '<label for="g">RGB: </label>' + '<?php' + 'echo \'<select id="g" name="g">\' . "\n";' + 'foreach($options as $option) {' + 'if ($option == $g) {' + 'echo \'<option value="\' . stripslashes(htmlentities(strip_tags($option))) . \'" selected="selected">\' .' + 'stripslashes(htmlentities(strip_tags($option))) . \'</option>\' . "\n";' + '} else {' + 'echo \'<option value="\'. stripslashes(htmlentities(strip_tags($option))) . \'">\' .' + 'stripslashes(htmlentities(strip_tags($option))) . \'</option>\'."\n";' + '}' + '}' + 'echo \'</select>\';' + '?></li>' ); }); });

    Read the article

  • Adding Unlimited Form Fields With JQuery Problem.

    - by TheCREATOR
    I'm fairly new to JQuery and I'm trying to add multiple form fields for example, <li id="container" id="add_field"><input type="text" name="text" value="text" /></li> but I think my JQuery code is off can some one please help me fix the JQuery code? Here is the JQuery script. var count = 0; $(function(){ $('li#add_field').click(function(){ count += 1; $('#container').append( '<li><input id="field_' + count + '" name="fields[]' + '" type="text" /></li>' ); }); }); Here is the html code. <form method="post" action="index.php"> <fieldset> <ul> <li><label for="code">Code: </label> <textarea rows="8" cols="60" name="code" id="code"></textarea></li> <li id="container" id="add_field"><input type="text" name="text" value="text" /></li> <li><label for="comment">Comments: </label> <textarea rows="8" cols="60" name="comment" id="comment"></textarea></li> <li><input type="submit" name="submit" value="Submit" /></li></ul> </fieldset> </form>

    Read the article

  • Trying to insert a row using stored procedured with a parameter binded to an expression.

    - by Arvind Singh
    Environment: asp.net 3.5 (C# and VB) , Ms-sql server 2005 express Tables Table:tableUser ID (primary key) username Table:userSchedule ID (primary key) thecreator (foreign key = tableUser.ID) other fields I have created a procedure that accepts a parameter username and gets the userid and inserts a row in Table:userSchedule Problem: Using stored procedure with datalist control to only fetch data from the database by passing the current username using statement below works fine protected void SqlDataSourceGetUserID_Selecting(object sender, SqlDataSourceSelectingEventArgs e) { e.Command.Parameters["@CurrentUserName"].Value = Context.User.Identity.Name; } But while inserting using DetailsView it shows error Procedure or function OASNewSchedule has too many arguments specified. I did use protected void SqlDataSourceCreateNewSchedule_Selecting(object sender, SqlDataSourceSelectingEventArgs e) { e.Command.Parameters["@CreatedBy"].Value = Context.User.Identity.Name; } DetailsView properties: autogen fields: off, default mode: insert, it shows all the fields that may not be expected by the procedure like ID (primary key) not required in procedure and CreatedBy (user id ) field . So I tried removing the 2 fields from detailsview and shows error Cannot insert the value NULL into column 'CreatedBy', table 'D:\OAS\OAS\APP_DATA\ASPNETDB.MDF.dbo.OASTest'; column does not allow nulls. INSERT fails. The statement has been terminated. For some reason parameters value is not being set. Can anybody bother to understand this and help?

    Read the article

1