943,929 Members | Top Members by Rank

Ad:
Apr 27th, 2009
0

how to get values through javascript and pasted in batch file

Expand Post »
Hi all,

1] I have to create one html file which uses javascript.
2] HTML page can be accessed by user and can fill the;
[A] Folder path along with file name
3] There will be a button, after click on that a batch file [already present but without any values] will run with new values provided by javascript.
4] Through that batch file i will process XML to HTML conversion.
5] After completion of batch 1 message should be given as "Process Over"

Purpose of this -
User will not interact directly with batch file. He/ She will just paste the path and file name and click on button.
Rest of the things will done in background.
User can see only output, without interrupting the actual process.

My HTML looks like below,
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Welcome to this project</title>
</head>
<body>
<h1 style="text-align:center;">Wel-come</h1>
<hr />
<table>
	<tr>
		<td>Please enter file name here</td>
		<td><input name="file_name" type="text" size="50" maxlength="50" id="fn1" /></td>
	</tr>
	<tr>
		<td>Please enter folder path here</td>
		<td><input name="folder_name" type="text" size="50" maxlength="20" id="fldn1"  /></td>
	</tr>
</table>
</body>
</html>

Please suggest is this possible? if yes how it can be done?
Any help will be appreciated as I am struggling this very much.

Cheers,
Mahesh
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mlohokare is offline Offline
22 posts
since Oct 2008
Apr 27th, 2009
0

Re: how to get values through javascript and pasted in batch file

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. fh = fopen(getScriptPath(), 0); // Open the file for reading
  2. if(fh!=-1) // If the file has been successfully opened
  3. {
  4. length = flength(fh); // Get the length of the file
  5. str = fread(fh, length); // Read in the entire file so you can do your job from here
  6. fclose(fh); // Close the file
  7.  
  8. // Display the contents of the file
  9. write(str);
  10. }
Reputation Points: 26
Solved Threads: 44
Posting Whiz in Training
mail2saion is offline Offline
247 posts
since Apr 2009
Apr 27th, 2009
0

Re: how to get values through javascript and pasted in batch file

Mlohokare,

Is the processing client-side (Javascript) or do you go server-side? Similarly, where is the source file; server-side or client-side?

If server-side is involved, then what are you running there: php, jsp, asp, cgi etc.?

It's not possible to answer your question witout knowing the basic architecture.

Airshow
Sponsor
Reputation Points: 318
Solved Threads: 358
WiFi Lounge Lizard
Airshow is offline Offline
2,527 posts
since Apr 2009
Apr 28th, 2009
0

Re: how to get values through javascript and pasted in batch file

Hi All,

Thanks for your instant replies.

Basically I am developing a small system which includes;
1] Saxon [for xml to html conversion]
2] XML files
3] XSLT files
4] Supporting files like css, common images etc.

This will be placed only once to end user machine.
So Client-Side methodology is involved here.

User can placed this as many machines they want with some basic limitations.

Here question is why i needed batch file creation in HTML [Javascript]?

Basically all will be done using batch file in Saxon. [File names are written in batch file and SAXON parser will take care of conversion.]

I want to create a GUI [I think HTML is the best and widely used] for user where he/ she will just place the file name and folder path in 2 different input box that value will be placed in batch file and when I click on process button on HTML page that batch file will run automatically [After completion of batch file processing automatically message will display that processing is over. {If possible only otherwise no message will dispaly}]

That is whole idea.

Is this possible??

Any further information required from me to solve this, i am always ready to share.

Cheers,
Mahesh
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mlohokare is offline Offline
22 posts
since Oct 2008
Apr 28th, 2009
0

Re: how to get values through javascript and pasted in batch file

Mahesh,

Aha, I see.

You are into areas I have not been. My immediate thought is that trying to use the browser interface is a non-starter because browsers basically exist for client-server work and have inbuilt security constraints which limit their ability to interact with the client computer, though a good applet developer may well be able to tell you different.

I reckon that VB/VBA would be more appropriate for your front end than HTML/browser. Another approach would be simply to use the operating system's command line to run Saxon.

Maybe there's a Saxon support forum where you can search for a solution.

Hope this helps.

Airshow
Sponsor
Reputation Points: 318
Solved Threads: 358
WiFi Lounge Lizard
Airshow is offline Offline
2,527 posts
since Apr 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: focus on the textbox
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: changing style on class using getElementsByClassName





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC