none
Vb-Script and HTML manipulation

    Question

  • Hello Experts,

    1. I am trying to manipulate a web page, which is made in ASP.
    2. On main page, I click, on Submit which pops a message box, when I click, Ok it saves, all data mentioned in text boxes.
    3. This is code of Submit button 
    <input 
    type="submit" 
    name="ctl00$ContentPlaceHolder1$btnSaveQASheet" 
    value="Save Data"
    onclick="return SavingData();
    WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(";ctl00$ContentPlaceHolder1$btnSaveQASheet";, ";";, true, ";Save";, ";";, false, false))"
    id="ctl00_ContentPlaceHolder1_btnSaveQASheet" title="Save data by clicking." 
    class="ButtonFormat" 
    style="height:25px;width:124px;" />                          

    1. Below is script code :
    <script>
    function SavingData() 
    {  
    var bisValid = Page_ClientValidate('Save'); 
    if(bisValid == true) 
    	{   
    	return confirm(' Do you want to Save this Audit ? ');  
    	} 
    else 
    	{
    	return false; 
    	}
    }
    
    function CallServer(arg, context)
    {
    WebForm_DoCallback('ctl00$Timeout1',arg,ReceiveServerData,context,null,false);
    }
    //]]>
    </script>
    

    1. What I have achieved is executing Java-script SavingData() using ParentWindow.execscript, but this bring, message box.
    2. I want to directly send ok message to script, without need to click on any pop up box.
    3. Also, I don't completely understand what is exactly : WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ContentPlaceHolder1$btnSaveQASheet&quot;, &quot;&quot;, true, &quot;Save&quot;, &quot;&quot;, false, false)) . Is it some HTML method or javascript function.
    4. Note : I have actually solved my problem using long way, VBA methods Appactivate and Windows API : Mouse Event (sendmessage method). But now I want to make it simple using just VBscript and html dom methods, and thus wish to learn how html dom works specially sending messages via script.

    With regards : Ajay Check

    • Moved by Bill_Stewart Saturday, November 24, 2012 4:04 PM Moving to more appropriate forum (From:The Official Scripting Guys Forum!)
    Saturday, November 24, 2012 3:58 PM

Answers

  • Hi,

    Please start a new thread for each question.

    this forum is for questions about html, css and scripting for website developers. asp.net questions should be directed to an asp.net forum.

    when asking a question it is helpful if you can provide a publicly accessible link to your website or a mashup.

    Placeholder controls are commonly used when using ajax responses.


    Rob^_^

    Saturday, November 24, 2012 9:14 PM

All replies

  • Hello Experts, 

    1. I am trying to automate a web page, which is made  in Asp, whose URL never changes, no matter on which link you are.
    2. Most of the task is done, problem arises when I click on submit button on Main page, and a web page dialog comes.
    3. This web page dialog, doesn't have any view source option, nor it displays its info via (objIe.LocationName,objIe.LocationURL,objDoc.Title, objDoc.URL.)
    4. On task bar, windows doesn't show its Window name and title, only Main page info is shown.
    5. Only its, status bar text shows some URL (http://xxx.xxx.xxx.xxx/xxxx/Home/ViewQA.aspx?rValue=634877540232164075)
    6. There are three button on Web page dialog box on which I have to click.
    7. This is inner HTML of Link of Main web page, which on clicking displays that Web page dialog box
    <a id="ctl00_ContentPlaceHolder1_gvSearchData_ctl02_lnkViewDetails" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$gvSearchData$ctl02$lnkViewDetails','')">View Details ...</a>
    &nbsp;
    <input type="hidden" name="ctl00$ContentPlaceHolder1$gvSearchData$ctl02$hddAuditId" id="ctl00_ContentPlaceHolder1_gvSearchData_ctl02_hddAuditId" value="493354" />
    

    1. And this is Javascript, which gets called after clicking  that link : 
    function openWindwow() 
    { var vReturnValue = window.showModalDialog('ViewQA.aspx?rValue=634877540798908442','','dialogWidth:1050px;dialogHeight:1050px;left:-7px,top:-2px'); 
    if( vReturnValue != null && vReturnValue == true) 
    {
    __doPostBack('ctl00$ContentPlaceHolder1$btnSearch',''); 
    return true; 
    } 
    }
    openWindwow()
    var Page_ValidationActive = false;
    if (typeof(ValidatorOnLoad) == "function") 
    {
        ValidatorOnLoad();
    }

    1. Is there any way, I can pass right info of Web page dialog box, directly through Javascript, thus bypassing dialog boxes and message boxes.

    With regards : Ajay Check

    • Merged by Bill_Stewart Saturday, November 24, 2012 4:02 PM Duplicate thread
    Saturday, November 24, 2012 3:43 PM
  • Hi,

    Please start a new thread for each question.

    this forum is for questions about html, css and scripting for website developers. asp.net questions should be directed to an asp.net forum.

    when asking a question it is helpful if you can provide a publicly accessible link to your website or a mashup.

    Placeholder controls are commonly used when using ajax responses.


    Rob^_^

    Saturday, November 24, 2012 9:14 PM
  • Hi,IECUSTOMIZER

    1. I did posted two questions separately, but you can see, they were moved and merged by AbqBill (<abbr class="affil">Microsoft Community Contributor</abbr> )

    With regards : Ajay Check

    Saturday, November 24, 2012 11:57 PM