• Resolved geowil

    (@geowil)


    Hello, does this plugin support HTMLand other simple things, like Javascript, being placed in them?

    I am trying to add some simple html coding to add a form within the tab but the plugin manager page keeps spitting out unserialized errors. Here is my code and the error:

    <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
    <script type="text/javascript">
    	 $(function(){
    		var errMsg;
    		
    		$('#NewUsrFrm').on('submit', function(event){
                           alert("test");
    			event.preventDefault();
    			
    			var dataStr = $("#NewUsrFrm").serialize()
                            alert(dataStr);
    			
    			$.ajax({
    				url: "/grant/php/addUser.php",
    				type: "post",
    				data: dataStr,
    				dataType: "json",
    				success: function(json){
    				    onUserAdded(json);
    				},
    				error: function(request, txStatus, errThrown){
    					alert("Error thrown on request.\nError: " + errThrown +"\nStatus: " + txStatus + "\nRequest: " + JSON.stringify(request));
    				}
    			});
    		});
    	 });
    	 
    	 function onUserAdded(json) {
    	 	var rtnData = JSON.stringify(json);
    	 	
    	 	//rtnData = replaceAll('{', '', replaceAll('}','', replaceAll('"','', replaceAll('\\','',rtnData))));
    	 	
    	 	if (json['Status'] == "Error"){
    	 		var eMsgLbl = document.getElementById("errMsg");
    	 		
    	 		eMsgLbl.innerHTML = json['Message'];
    	 	} else{
    	 		alert("The user was added successfully.");
    	 	}
    	 	
    	 }
    	 
    	 function replaceAll(find, replace, str) {
    		while( str.indexOf(find) > -1) {
    			str = str.replace(find, replace);
    		}
    
    		return str;
    	}
    </script>
    
    <label ID="errMsg" style="color: red; font-size:14px; font-weight:bold;"></label><br/>
    	<label for="NewUsrFrm">New User Form:</label>
    	<form ID="NewUsrFrm" method="post" action="/grant/php/addUser.php">
    		<fieldset>
    		    <legend>User Information</legend>
    		    <label for="UsrFName">First Name:&nbsp;</label><input type="text" name="UsrFName"/><br/>
    		    <label for="UsrLName">Last Name:&nbsp;</label><input type="text" name="UsrLName"/><br/>
    		    <label for="UsrAge">Age:&nbsp;</label><input type="number" min="1" name="UsrAge" Value="1"/><br/>
    		</fieldset><br/>
    
    		<fieldset>
    		    <legend>Login Information</legend>
    		    <label for="UsrName">Username:&nbsp;</label><input type="text" name="UsrName"/><br/>
    		    <label for="UsrPass">Password:&nbsp;</label><input type="password" name="UsrPass"/><br/>
    		    <label for="UsrGrp">Group:&nbsp;</label><input type="number" name="UsrGrp"/><br/>
    		    <label for="UsrType">Type:&nbsp;</label>
    		    <select name="UsrType">
    		        <option value="0">Student</option>
    		        <option value="1">Parent</option>
    		        <option value="2">Administrator</option>
    		    </select>
    		</fieldset><br/>
    
    		<!--<button type="submit" ID="frmBtnSub">Create User</button>--!>
    	</form>

    Notice: unserialize(): Error at offset 2782 of 2782 bytes in /var/www/html/wp-content/plugins/tabs-responsive/ink/admin/add-tabs.php on line 55

    Warning: Invalid argument supplied for foreach() in /var/www/html/wp-content/plugins/tabs-responsive/ink/admin/add-tabs.php on line 61

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Can’t place HTML into Tab’ is closed to new replies.