Search Results

Search found 175 results on 7 pages for 'onsubmit'.

Page 5/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • Client-side validation breaks in IE because of PropertyProxyValidator and ScriptManager cooperation.

    - by Eugene
    The specific of the project is in using Enterpise Library for Server side validation and jQuery for client-side validation. So I have the next simple form for example: <asp:Content ID="_mainContent" ContentPlaceHolderID="MainContent" runat="server"> <script src="../../../Scripts/jquery-1.3.2.js" type="text/javascript"></script> <script src="../../../Scripts/jquery.validate.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $("#aspnetForm").validate({ rules: { "<%= _txtProjectName.UniqueID %>": { required: true } } }); }); </script> <asp:TextBox ID="_txtProjectName" runat="server" CssClass="textBoxWithValidator_long" /> <entlib:PropertyProxyValidator id="_validatorProjectName" runat="server" ControlToValidate="_txtProjectName" PropertyName="ProjectName" SourceTypeName="LabManagement.Project.Project" /> <asp:Button CssClass="cell_InlineElement" ID="_btnSave" runat="server" Text="Save" onclick="_btnSave_Click" Width="50px" /> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"> </asp:ScriptManager> </asp:Content> The problem is in the next: client-side validation worked correctly before I needed to implement some AJAX.NET feature. So I have to add to the page ScriptManager (the last two lines in the code). But after that the next situation appeared: In InternetExplorer((7) - only in IE !!! - in Firefox everything works correctly) after clicking save button, if left the textbox ProjectName empty the client-side jquery validation appears but (!) the page submits to the server anyway. Some notes: If delete PropertyProxyValidator from the page - the client-side validation works correctly in IE but I need it for specific of the project. It seems that the problem is in the function WebForm_OnSubmit() that is inserted to the form after PropertyProxyValidator adding. ( ... <form name="aspnetForm" method="post" action="Project.aspx?TransType=NewProject" onsubmit="javascript:return WebForm_OnSubmit();" ...>) Could anyone help, please.

    Read the article

  • Can Content script set value of a text box within HTML frame? using Google Chrome extensions..

    - by devdreamers
    Hi all, I was working on a very simple extension, where on clicking extension icon, a webpage is opened in a new tab, the webpage has HTML frames, within which lies a textbox. I want to set a value for the same. The webpage which opens has: <HTML> <FRAMESET rows="15%, *" border="0"> <FRAME src="./files/abc.htm" id="abc_frame" name="abc_frame" onload="abcLoad()" scrolling="NO"> </FRAMESET> </HTML> and abc.htm has: <div align="center" valign="bottom" style="font-size: 1em;"> <form onSubmit="javascript:navigate(this);return false;"> <label for="loc">Loc</label>: <input type="text" size="50" id="loc" value="http://google.com"/> <input name="go" type="submit" value="Go" id="loc_go" onclick='navigate(this); return false;'/> </form> </div> how can I replace current textbox value with, say http://yahoo.com ? I guess, Content Script in Chrome extensions is required, but not sure, how/what should be it's code/content. Please guide/help. Thanks a lot. Appreciate it.

    Read the article

  • How to handle image/gif type response on client side using GWT

    - by user200340
    Hi all, I have a question about how to handle image/gif type response on client side, any suggestion will be great. There is a service which responds for retrieving image (only one each time at the moment) from database. The code is something like, JDBC Connection Construct MYSQL query. Execute query If has ResultSet, retrieve first one { //save image into Blob image, “img” is the only entity in the image table. image = rs.getBlob("img"); } response.setContentType("image/gif"); //set response type InputStream in = image.getBinaryStream(); //output Blob image to InputStream int bufferSize = 1024; //buffer size byte[] buffer = new byte[bufferSize]; //initial buffer int length =0; //read length data from inputstream and store into buffer while ((length = in.read(buffer)) != -1) { out.write(buffer, 0, length); //write into ServletOutputStream } in.close(); out.flush(); //write out The code on client side .... imgform.setAction(GWT.getModuleBaseURL() + "serviceexample/ImgRetrieve"); .... ClickListener { OnClick, then imgform.submit(); } formHandler { onSubmit, form validation onSubmitComplete ??????? //handle response, and display image **Here is my question, i had tried Image img = new Image(GWT.getHostPageBaseURL() +"serviceexample/ImgRetrieve"); mg.setSize("300", "300"); imgpanel.add(img); but i only got a non-displayed image with 300X300 size.** } So, how should i handle the responde in this case? Thanks,

    Read the article

  • Unable to send '+' through AJAX post?

    - by Harish Kurup
    I am using Ajax POST method to send data, but i am not able to send '+'(operator to the server i.e if i want to send 1+ or 20k+ it will only send 1 or 20k..just wipe out '+') HTML code goes here.. <form method='post' onsubmit='return false;' action='#'> <input type='input' name='salary' id='salary' /> <input type='submit' onclick='submitVal();' /> </form> and javascript code goes here, function submitVal() { var sal=document.getElementById("salary").value; alert(sal); var request=getHttpRequest(); request.open('post','updateSal.php',false); request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); request.send("sal="+sal); if(request.readyState == 4) { alert("update"); } } function getHttpRequest() { var request=false; if(window.XMLHttpRequest) { request=new XMLHttpRequest(); } else if(window.ActiveXObject) { try { request=new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { request=new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { request=false; } } } return request; } in the function submitVal() it first alert's the salary value as it is(if 1+ then alerts 1+), but when it is posted it just post's value without '+' operator which is needed... is it any problem with query string, as the PHP backend code is working fine...

    Read the article

  • unable to use html form post in php

    - by kossibox
    Hello i have an html form and i'm posting data but i'm unable to get the posted data on a php page (same page) can you please help me. thanks in advance <div class="left"> <form name="form_signin" method="post" onsubmit="return signinValid();" > <table> <tr> <td> Email : </td> <td> <input type="text" id="email" length ="40"> </td> </tr> <tr> <td> Mot de Passe : </td> <td> <input type="password" id ="pass" length ="40"> </td> </tr> <tr> <td> &nbsp; </td> <td> <input type="submit" value="Connexion" length ="40"> </td> </tr> </table> </form> <?php include 'includes.php'; include DB_CONNECT_FILE; //session_start(); print_r($_POST); // prints an empty array even if fields are filled $smart->assign('tpl_file',TEMPLATES_DIR.'signin.html'); $smart->display(TEMPLATES_DIR."with_right.html"); include DB_DISCONNECT_FILE; ?>

    Read the article

  • Using struts 2 with no tags

    - by WannaAsk
    Hi everyone, I wonder if you could guide me on this struts issue - I feel hopeless on this... I am working on migrating our web application to a Struts 2 portlet (I'm using Struts 2.1.8). The thing is, I am forced to avoid struts tags because our application relies on Dijit widgets, which are omitted when using struts tags. So now I should implement the <s:form tag using scriptlets. My question is: how you would suggest I imitate the way struts handles the "action" attribute? Right now it appears I should: Create a regular html form in my jsp. Get/create the ActionConfig object during onsubmit and set on it values which match my desired destination: class+method+result jsp. Execute the action I set in 2. Would you recommend this? If so - is ActionConfig obtained from the session? Can I initiate an action execution from ActionConfig? (Aletrnatively... generating an action url using struts' form.vm file - what do you say?) I would appreciate any help on this - Thanks a lot in advance!!!

    Read the article

  • Why is my PHP upload script not working?

    - by Turner
    Hello all, I am doing some simple work with uploading a file. I am ignoring error checking and exceptions at this point just to get my uploads working. I have this HTML form: <form action='addResult.php' method='post' enctype='multipart/form-data' target='results_iFrame' onsubmit='startUpload();'> Entry: <input type='text' id='entry' /> Stop: <input type='text' id='stop' /> Final: <input type='text' id='final' /> Chart: <input type='file' id='chart' /> <input type='submit' value='Add' /></form> As you can see, it calls 'addResult.php' within the iFrame 'results_iFrame'. The Javascript is just for animation purposes and to tell me when things are finished. addResult.php has this code in it (along with processing the other inputs): $upload_dir = "../img/"; $chart_loc = $upload_dir.basename($_FILES['chart']['name']); move_uploaded_file($_FILES['chart']['tmp_name'], $chart_loc); print_r($_FILES); It uses the 'chart' input from the form and tries to upload it. I have the print_r() function to display some information on $_FILES, but the array is empty, thus making this fail. What could I be doing wrong?

    Read the article

  • javascript check function for a html form

    - by Reteras Remus
    I'm having a problem with a HTML form (name, e-mail, subject, message), I can't validate the form if it was completed correct or not. I want to call a javascript function when the form is submitted and alert if a field wasn't completed correct. My problem is with the submit button, because my boss said that I must use he's own php function to insert a submit button. The php function looke like: function normal_button($text, $width, $param = '', $class = 'button-blue') { $content = '<div class="'.$class.'" style="width:'.$width.'px;" '.$param.'>'.$text.'</div>'; return $content; } and how I call the function: echo normal_button('Send it', '100', 'onclick="document.getElementById(\'emailForm\').submit();" '); I tried to call the js function declaring the onSubmit="return checkForm(this)" in the <form action='email.php' method='post'> HTML form, but I can't "catch" the submit. Also I tried to catch it with jquery, $(document).ready(function() { $('.normal_button').click(function() { }); ); but I can't return false if a field wasn't completed correct. I must use he's PHP function to insert the submit button, but how can I "catch" the fields, how can I validate them? Any suggestions? Thank you !

    Read the article

  • I expect to see in the browswer "http://path/some_page.html" but instead it identifies with "http:/

    - by indiehacker
    I am developing with app engine SDK. I have a feeling this is much too basic a question so apologies ahead of time... A simple submit button doesnt work instead of just showing an alert box as expected it continues on afterwards and redirects me to the latest http-request, and I think this is because I dont understand how to tell the browser to recognize the proper URLs. Why does my browser say I am at the most recent http-request http://localhost:8080/putProjectInDB rather than the somepage.html that was actually served to the browser that I am currently looking at? How can I get the browser to recognize and show in its url spot the normal expected http://somepage.html ? Just in case, here are details of the specific problem which you might be able to ignore for answering the question: This hasnt been mattered for me until I just wanted to put into my .html a simple button that changes some stuff of the page without needing the server. The below code after displaying the alert box redirects me to the last server request http://localhost:8080/putProjectInDB instead of just staying in the same html page. in header: function MyFormCommands() { alert('Some Text'); } in body: <form onSubmit="MyFormCommands()" ><input type=submit ></form >

    Read the article

  • AJAX: Permission denied to access property in iframe

    - by Muhammad Sajid
    Hi I created an php website which uses for AJAX post and was live at http://sprook.com.au/ but my client change it's domain to http://www.sprookit.net/ from his service provider Godaddy and now the firebug says: Permission denied to access property 'stopAjax' here stopAjax is my method name. script is there: <div class="post_area"> <form action="post.php" method="post" id="addVideo" enctype="multipart/form-data" target="post" onsubmit="return startAjax(this);"> <iframe id="post" name="post" src="#" style="width:0;height:0;border:0px solid #fff;"></iframe> <table width="860" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="435">POST YOUR AD FREE<br /> <em>Paste embed code from YouTube</em></td> <td width="322"><input type="text" id="videoLink" name="videoLink" class="input_textbox" /> </td> <td width="95"><input type="submit" name="set_video_link" id="set_video_link" value="" class="submt_post" /> </td> </tr> <tr> <td>&nbsp;</td> <td><div id="process"> Connecting please wait <img src="images/loading.gif" /><br/> </div></td> </tr> </table> </form> </div> And all content comes from old domain i removed index file and it stoped working, therefore it is cleared that scripts run from old domain.

    Read the article

  • JSP getParameter problem

    - by user236501
    I have a form, if the timer reach the form will auto redirect to the Servlet to update database. My problem now is if javascript redirect the window to servlet my request.getParameter is null. function verify(f,whichCase){ if(whichCase == "Submit"){ msg = "Are you sure that you want to submit this test?"; var i = confirm(msg) if(i){ parent.window.location = "sindex.jsp" } return i; } } I doing this because i got a iframe in my jsp. Timer update problem have to use iframe. So, when time up or user click submit parent.window.location can let me refresh parent window <form method="POST" action="${pageContext.request.contextPath}/TestServlet" onSubmit="return verify(this,whichPressed)"> My form when user click submit button within the timing, it will trigger the verify function to let user confirm submit. So inside my TestServlet i got this, because using javascript redirect request.getParameter("answer") this keep return me null. protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getParameter("Submit") != null) { String ans = request.getParameter("answer"); Answer a = new Answer(ans, no); aa.CreateAnswer(an,t.getTestCode(),username); RequestDispatcher rd = request.getRequestDispatcher("/sindex.jsp"); rd.forward(request, response); } } Below are my timer when time up redirect to TestServlet trigger the doGet method if((mins == 0) && (secs == 0)) { window.alert("Time is up. Press OK to submit the test."); // change timeout message as required var sUrl = "TestServlet"; parent.window.location = sUrl // redirects to specified page once timer ends and ok button is pressed } else { cd = setTimeout("redo()",1000); }

    Read the article

  • jQuery Form Validation being bypassed

    - by user1953681
    Can someone tell me what is wrong with my jQuery validation? It is not validating my form, rather, just ignoring the code resulting in no check of the inputs. Form: <form class="form" accept-charset="UTF-8" action="URL-to-complete-form" method="POST" onsubmit="return validateForm();"> <input class="form-name" type="text" placeholder="Name"></div> <input class="form-email" type="text"placeholder="Email"></div> <input style="background-color: #fc8f12;" type="submit" value="Subscribe"> </div> </form> Javascript: function validateForm() { // Validate Name var title = $(".form-name").val(); if (title=="" ||title=="Name" || title==null) { } else { alert("Please enter a name!"); } // Validate Email var email = $(".form-email").val(); if ((/(.+)@(.+){2,}\.(.+){2,}/.test(email)) || email=="" || email=="Email" || email==null) { } else { alert("Please enter a valid email"); } return false; } Thank you all for your time and help.

    Read the article

  • validation before ajax form submission

    - by ZX12R
    How do i introduce validation before remote_form_for submits? I have javascript function called validateForm(). I am able to call it before the AJAX request process. I tried to use return false and event.preventDefault. But there seems to be no effect. Here is what my code looks like <% remote_form_for :customer, :update =>"uxScreenLoaderDiv", :url => {:action => "login", :controller => "site"}, :html => {:id => "uxLoginForm"}, :onsubmit => "validateForm(event)" do |f| %> User name : <%= f.text_field "uxUserName", :class => "TextBox", :style => "width:100px;" %>&nbsp;* &nbsp;Password : <%= f.password_field "uxPassword", :class => "TextBox", :style => "width:100px;" %>&nbsp;* <%= f.submit "Go!", :class => "Button-Simple", :id => "uxSubmitButton" %> <% end %> the javascript function is simple as follows function validateForm(event){ return false; //event.preventDefault(); }

    Read the article

  • http post request with cross-origin in javascript

    - by Calamarico
    i have a problem with a http post call in firefox. I know that when there are a cross origin, firefox first do a OPTIONS before the POST to know the access-control-allow headers. With this code i dont have any problem: Net.requestSpeech.prototype.post = function(url, data) { if(this.xhr != null) { this.xhr.open("POST", url); this.xhr.onreadystatechange = Net.requestSpeech.eventFunction; this.xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8"); this.xhr.send(data); } } I test this code with a simple html that invokes this function. Everything is ok and i have the response of the OPTIONS and POST, and i process the response. But, i'm trying to integrate this code with an existen application with uses jquery (i dont know if this is a problem), when the send(data) executes in this case, the browser (firefox) do the same, first do a OPTION request, but in this case dont receive the response of the server and puts this message in console: [18:48:13.529] OPTIONS http://localhost:8111/ [undefined 31ms] Undefined... the undefined is because dont receive the response, but the code is the same, i dont know why in this case the option dont receive the response, someone have an idea? i debug my server app and the OPTIONS arrive ok to the server, but it seems like the browser dont wait to the response. edit more later: ok i think that the problem is when i run with a simple html with a SCRIPT tag that invokes the method who do the request run ok, but in this app that dont receive the response, i have a form that do a onsubmit event, i think that the submit event returns very fast and the browser dont have time to get the OPTIONS request. edit more later later: WTF, i resolve the problem make the POST request to sync: this.xhr.open("POST", url, false); The submit reponse very quickly and can't wait to the OPTION response of the browser, any idea to this?

    Read the article

  • Uploading File Problem in PHP on Drupal

    - by Nitz
    I don't know why but i had written clear cut code for uploading file in my page. i had written like this... on the client side. <form id="recipeform" onsubmit="return checkAll()" action="submit.php" method="post" class="niceform" enctype="multipart/form-data"> <input name="uploaded" type="file" /> And on submit.php... i am writting like this..... $target = "newupload/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)){ echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded"; } else{ echo "Sorry, there was a problem uploading your file."; } simple code but then also i can't able to upload the file.. And i had made my webiste in Drupal. Thanks in advance. www.panchjanyacorp.com

    Read the article

  • html escape characters

    - by user1468537
    I have the following: <form name="input" method="get" action="http://site:8083/Default.aspx?DC=" target="foo" onSubmit="window.open('', 'foo', 'width=1100 height=500,status=no,resizable=yes,scrollbars=yes')"> <select name="DC"> <option value="1&Type=type1">1</option> <option value="2&Type=type2">2</option> <option value="3&Type=type3">3</option> <option value="4&Type=type4">4</option> <option value="5&Type=type5">5</option> <option value="6&Type=type6">6</option> <option value="7&Type=type7">7</option> </select> <input type="submit" value=">>"/>&nbsp;&nbsp; </form> Basically my querystring should be something like DC=1&Type=type1 the problem I have is that when I click the button above the html screws up the stirng by changing & to %26 and = to %3D How can I make the value stay as I have it in the code above?

    Read the article

  • stop form during submission if it validates incorrectly

    - by muqman
    I am trying to use JavaScript to validate forms but if the form doesn't validate, I don't want the form to be sent to the "action" page. The validator: <script> function formSubmit() { document.getElementById("signup_form").submit(); var x=document.forms["signup_form"]["tname"].value; if (x==null || x=="") { alert("First name must be filled out"); return false; } } </script> The form itself: <form action="some_file.php" method="post" id="signup_form" name="signup_form" onsubmit="return formSubmit()"> But all this does is if the tname field empty, it will return an alert but as soon as the user hits ok, the form then redirects to some_file.php. What have I missed here? The submit button: <a href="" onclick="return formSubmit(); return false" class="purplebutton">Signup</a> So what have I missed? How do I avoid this in the future?

    Read the article

  • How to get a specific attribute from an object list?

    - by anarhikos
    I've an array keeping a list of Group objects. I want to set this list to the DropDownChoice component. However I want to show the end user only the name attribute of Group objects, and then get the selected values' id attribute to add database. What to do? private List<Group> groupTypes; DatabaseApp db = new DatabaseApp(); groupTypes = db.getGroups(); groupDropDownChoice = new DropDownChoice("type", groupTypes); ... ... addUserForm.add(new Button("submit"){ @Override public void onSubmit(){ Group group = (Group) groupDropDownChoice.getModelObject(); ... ... db.addUser(group.getId(), den, name, login, email, password1); DatabaseApp.java public List<Group> getGroups() throws SQLException{ List<Group> groups = new ArrayList<Group>(); try { String query = "SELECT * FROM [GROUP]"; Statement statement = db.createStatement(); ResultSet result = statement.executeQuery(query); while(result.next()){ int id = result.getInt("ID"); String name = result.getString("NAME"); groups.add(new Group(id, name)); } result.close(); } catch (SQLException ex) { throw new SQLException(ex.getMessage()); } return groups; }

    Read the article

  • how to arrange the checkboxes in 3/3 format on a layout of a form

    - by anwaar
    hi there can anyone plz tell me how to arrange the list of checkboxes of cuisines label which is retrived from the data base and when it is displaying it is not in the order coming side by side all together i want it to be displayed in a 3 by 3 format.here is the code for that: <div id="frmform"> <form name="frmrestaurant" id="frmrestaurant" method="post" onsubmit="" enctype="multipart/form-data"> <p class="msgsignup">Add Restaurant</p> <div id="iderror"></div> <div class="topinputs"> <div> <label for="restaurant_name" class="name">Restaurant Name :</label><input type="text" name="restaurant_name" size="32" id="restaurant_name" value="<?php echo $row->restaurant_name; ?>" class="validate[required,custom[onlyLetter],length[0,100]] text-input" /> </div> </div> <div> <label for="website" class="name">Website :</label><input size="32" type="text" name="website" id="website" value="<?php echo $row->website; ?>" class="validate[required,length[0,100]] text-input" /> </div> <div> <label for="budget" class="name">Budget :</label> <?php echo $this->lists['budget'];?> </div> <div> <label for="idcuisine" class="cuisine" >Cuisine:</label> <?php echo $this->lists['cuisine'] ;?> <div> <label for="idcategory" class="category">Category:</label> <?php echo $this->lists['category'];?> </div> the lists of cuisine and category is not displaying properly. thanks.

    Read the article

  • document.getElementById('form_name').submit() not working properly

    - by Leahn Novash
    Ok, I will try to give the most details I can. The site is not suposed to work with IE6. It would be nice if it worked with IE8 and Chrome, but that can be done later. The site is in PHP. The form where the submit is in another PHP file that is included in position on the index.php inside of a DIV tag. If I open the form solely, the submit works correcly, but when I try to submit on the index page, the Firefox error console says that document is undefined. The form code is echoed line by line via PHP. Save the text fields for username and password, the form code is the following: <form id="entrar" action="entrar.php" method="post" onsubmit="javascript:checkvalues();"> <a href="javascript:document.getElementById('entrar').submit();">ENTRAR</a> </form> What's the big deal? What am I missing here? I know it is something very silly but I can't figure it out.

    Read the article

  • Use jQuery.post() result in javascript function

    - by Juvlius
    I've got no clue how to do the following, so I wasn't sure what to search for either. For validating my registration form I've a javascript function that checkes the existence of the inserted username in the database onblur of the username textfield. function checkUsername(username){ $.post("checkmail.php", {mail: mailcheck} , function(data){ var $response=$(data); var response = $response.filter('#mail-response').text(); if(response == "taken") { document.getElementById('username').style.borderColor = rood; valid = false; } }); } This works fine, but now I want to validate it again onsubmit of the form in case users decide to submit an existing username. function validateForm() { var valid = true; //checks different fields //now check voor username existence var username = document.getElementById('username').value; checkUsername.call(username); if (!valid) { return false; } else { return true; } } I'm not familiar enough with Javascript to get this working. Probably thinking in the wrong direction...

    Read the article

  • Rich Text Editor (YUI Simple Text Editor used) not sending data to next page

    - by Aman Chhabra
    I am using a simple text editor from YUI, but when I click submit the code in the textarea/editor is not sent to the next page. I want to be able to receive it on the subsequent page and then store it in a DB(MySql). I have wasted lot of time already. Please help. HTML FILE: <html> <head> <script type="text/javascript" src="http://yui.yahooapis.com/combo?2.9.0/build/yahoo-dom-event/yahoo-dom-event.js&2.9.0/build/container/container_core-min.js&2.9.0/build/element/element-min.js&2.9.0/build/editor/simpleeditor-min.js"></script> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/editor/assets/skins/sam/simpleeditor.css" /> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/assets/skins/sam/skin.css"> <!-- Utility Dependencies --> <script src="http://yui.yahooapis.com/2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js"></script> <script src="http://yui.yahooapis.com/2.8.2r1/build/element/element-min.js"></script> <!-- Needed for Menus, Buttons and Overlays used in the Toolbar --> <script src="http://yui.yahooapis.com/2.8.2r1/build/container/container_core-min.js"></script> <script src="http://yui.yahooapis.com/2.8.2r1/build/menu/menu-min.js"></script> <script src="http://yui.yahooapis.com/2.8.2r1/build/button/button-min.js"></script> <!-- Source file for Rich Text Editor--> <script src="http://yui.yahooapis.com/2.8.2r1/build/editor/editor-min.js"></script> <script> YAHOO.util.Event.on('submit', 'click', function() { myEditor.saveHTML(); var html = myEditor.get('element').value; }); (function() { var Dom = YAHOO.util.Dom, Event = YAHOO.util.Event; var myConfig = { height: '200px', width: '900px', dompath: true, }; myEditor = new YAHOO.widget.SimpleEditor('msgpost', myConfig); myEditor.render(); })(); </script> </head> <body class="yui-skin-sam"> <form action="submit.php" method="post"> <textarea name="msgpost" id="msgpost" cols="50" rows="10"></textarea> <input type="submit" value="Submit" onsubmit="return myDoSubmit()"/> </form> </body> </html>

    Read the article

  • Uploading on Youtube via HTTP Post

    - by sajid.nizami
    I am following the steps provided on this link [http://code.google.com/apis/youtube/2.0/developers_guide_dotnet.html#Browser_based_Upload][1] Whenever I try to upload anything using this method, I get a HTTP 400 error saying that the next_url is not provided. Code is pretty simple and is a copy of Google's own code. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="BrowserUpload.aspx.cs" Inherits="BrowserUpload" %> <%@ Import Namespace="Google.YouTube" %> <%@ Import Namespace="Google.GData.Extensions.MediaRss" %> <%@ Import Namespace="Google.GData" %> <%@ Import Namespace="Google.GData.YouTube" %> <%@ Import Namespace="Google.GData.Client" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> function checkForFile() { if (document.getElementById('file').value) { return true; } document.getElementById('errMsg').style.display = ''; return false; } </script> </head> <body> <% YouTubeRequestSettings settings = new YouTubeRequestSettings("Danat", "API-KEY", "loginid", "password" ); YouTubeRequest request = new YouTubeRequest(settings); Video newVideo = new Video(); newVideo.Title = "My Test Movie"; newVideo.Tags.Add(new MediaCategory("Autos", YouTubeNameTable.CategorySchema)); newVideo.Keywords = "cars, funny"; newVideo.Description = "My description"; newVideo.YouTubeEntry.Private = false; newVideo.Tags.Add(new MediaCategory("mydevtag, anotherdevtag", YouTubeNameTable.DeveloperTagSchema)); FormUploadToken token = request.CreateFormUploadToken(newVideo); %> <form action="<%= token.Url %>?next_url=<%= Server.UrlEncode("http://www.danatev.com") %>" name="PostToYoutube" method="post" enctype="multipart/form-data" onsubmit="return checkForFile();" > <input id="file" type="file" name="file" /> <div id="errMsg" style="display: none; color: red"> You need to specify a file. </div> <input type="hidden" name="token" value="<%= token.Token %>" /> <input type="submit" value="go" /> </form>

    Read the article

  • Spring validation errors not displayed

    - by Art Vandelay
    I have the following situation. I have a validator to validate my command object and set the errors on a Errors object to be displayed in my form. The validator is invoked as expected and works okay, but the errors i set on the Errors objects are not displayed, when i am sent back to my form because of the validation errors. Validator: public void validate(Object obj, Errors err) { MyCommand myCommand = (MyCommand) obj; int index = 0; for (Field field : myCommand.getFields()) { if (field.isChecked()) { if ((field.getValue() == null) || (field.getValue().equals(""))) { err.rejectValue("fields[" + index + "].value", "errors.missing"); } } index++; } if (myCommand.getLimit() < 0) { err.rejectValue("limit", "errors.invalid"); } } Command: public class MyCommand { private List<Field> fields; private int limit; //getters and setters } public class Field { private boolean checked; private String name; private String value; //getters and setters } Form: <form:form id="myForm" method="POST" action="${url}" commandName="myCommand"> <c:forEach items="${myCommand.fields}" var="field" varStatus="status"> <form:checkbox path="fields[${status.index}].checked" value="${field.checked}" /> <c:out value="${field.name}" /> <form:input path="fields[${status.index}].value" /> <form:errors path="fields[${status.index}].value" cssClass="error" /></td> <form:hidden path="fields[${status.index}].name" /> </c:forEach> <fmt:message key="label.limit" /> <form:input path="limit" /> <form:errors path="limit" cssClass="error" /> </form:form> Controller: @RequestMapping(value = REQ_MAPPING, method = RequestMethod.POST) public String onSubmit(Model model, MyCommand myCommand, BindingResult result) { // validate myCommandValidator.validate(myCommand, result); if (result.hasErrors()) { model.addAttribute("myCommand", myCommand); return VIEW; } // form is okay, do stuff and redirect } Could it be that the paths i give in the validator and tag are not correct? The validator validates a command object containing a list of objects, so that's why i give a index on the list in the command object when registering an error message (for example: "fields["+index+"]".value). Or is it that the Errors object containing the errors is not available to my view? Any help is welcome and appreciated, it might give me a hint or point me in right direction.

    Read the article

  • Coldfusion Components:- The argument passed to the function is not of type numeric

    - by salim.vali
    Hi I have a simple form form.cfm:- <cfset Registr = createObject("component", "forms.Registr") /> <cfset setFoo = createObject('component','forms.Registr).putNUsr(username,password,rating) /> <form name="regFrm" action="#cgi.script_name#" method="post" onsubmit="submitform();" > <tr><td>Username:</td> <td><input type="text" name=" Username" value="#form. Username#" ></td></tr> <tr><td>Password:</td> <td><input class="" type="password" name="password" value="#form.password#" ></td></tr> <tr><td>Rate:</td> <select name="rating" > <option value="" ></option> <cfloop query="qGetReting"> <option value="#rating_id#" <cfif form. rating eq prof_id>selected</cfif> >#rating#</option> </cfloop> </select> </td> </tr> </form> Now there is this cfc called Registr.cfc in the "forms" folder which has an insert-function called 'putNUsr'the code for 'Registr.cfc' is as follows. <cfcomponent> <cffunction name="putNUsr" returntype="void" displayname="" output="no"> <cfargument name="password" type="string" required="true"> <cfargument name="rating" type="numeric" required="true"> <cfargument name="username" type="string" required="true"> <cfquery datasource="#application.xyz#" name="q_putNUsr"> insert into users (username , password , rating) values( <cfqueryparam value="#arguments. username#" cfsqltype="CF_SQL_VARCHAR" />, <cfqueryparam value="#arguments.password#" cfsqltype="CF_SQL_VARCHAR" />, <cfqueryparam value="#arguments.rating#" cfsqltype="CF_SQL_INTEGER" ) </cfquery> </cffunction> </cfcomponent> I am able to populate the DB with the data if I do not use the form field "rating" which is numeric. Else i am getting the error as follows:- The RATING argument passed to the putNUsr function is not of type numeric. If the component name is specified as a type of this argument, it is possible that either a definition file for the component cannot be found or is not accessible. KINDLY HELP -S Vali

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >